From 26458adc8a660256c5260625642b8a169e3d18f9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 22 Jul 2021 02:29:49 +0000 Subject: [PATCH] CodeGen from PR 15299 in Azure/azure-rest-api-specs Merge 964fa70318739c8f1e123e7c74de22350c90fef6 into 56444d66e9733afaabc00d5f979dce1c837a61cd --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 + .../pom.xml | 86 + .../compute/generated/ComputeManager.java | 788 ++ .../fluent/AvailabilitySetsClient.java | 210 + .../CapacityReservationGroupsClient.java | 232 + .../fluent/CapacityReservationsClient.java | 335 + .../CloudServiceOperatingSystemsClient.java | 144 + .../CloudServiceRoleInstancesClient.java | 413 + .../fluent/CloudServiceRolesClient.java | 78 + .../generated/fluent/CloudServicesClient.java | 778 ++ .../CloudServicesUpdateDomainsClient.java | 178 + .../fluent/ComputeManagementClient.java | 362 + .../fluent/DedicatedHostGroupsClient.java | 188 + .../fluent/DedicatedHostsClient.java | 285 + .../generated/fluent/DiskAccessesClient.java | 593 ++ .../fluent/DiskEncryptionSetsClient.java | 370 + .../fluent/DiskRestorePointsClient.java | 302 + .../compute/generated/fluent/DisksClient.java | 401 + .../generated/fluent/GalleriesClient.java | 293 + .../GalleryApplicationVersionsClient.java | 398 + .../fluent/GalleryApplicationsClient.java | 341 + .../fluent/GalleryImageVersionsClient.java | 370 + .../generated/fluent/GalleryImagesClient.java | 313 + .../fluent/GallerySharingProfilesClient.java | 80 + .../generated/fluent/ImagesClient.java | 268 + .../generated/fluent/LogAnalyticsClient.java | 136 + .../generated/fluent/OperationsClient.java | 36 + .../ProximityPlacementGroupsClient.java | 187 + .../generated/fluent/ResourceSkusClient.java | 37 + .../fluent/RestorePointCollectionsClient.java | 244 + .../generated/fluent/RestorePointsClient.java | 194 + .../fluent/SharedGalleriesClient.java | 73 + .../SharedGalleryImageVersionsClient.java | 97 + .../fluent/SharedGalleryImagesClient.java | 81 + .../generated/fluent/SnapshotsClient.java | 404 + .../generated/fluent/SshPublicKeysClient.java | 214 + .../generated/fluent/UsagesClient.java | 41 + .../VirtualMachineExtensionImagesClient.java | 114 + .../VirtualMachineExtensionsClient.java | 295 + .../fluent/VirtualMachineImagesClient.java | 175 + .../VirtualMachineImagesEdgeZonesClient.java | 210 + .../VirtualMachineRunCommandsClient.java | 353 + ...irtualMachineScaleSetExtensionsClient.java | 299 + ...lMachineScaleSetRollingUpgradesClient.java | 213 + ...tualMachineScaleSetVMExtensionsClient.java | 348 + ...ualMachineScaleSetVMRunCommandsClient.java | 346 + .../VirtualMachineScaleSetVMsClient.java | 954 +++ .../fluent/VirtualMachineScaleSetsClient.java | 1388 ++++ .../fluent/VirtualMachineSizesClient.java | 39 + .../fluent/VirtualMachinesClient.java | 1273 ++++ .../fluent/models/AccessUriInner.java | 39 + .../fluent/models/AvailabilitySetInner.java | 216 + .../models/CapacityReservationGroupInner.java | 143 + .../models/CapacityReservationInner.java | 213 + .../fluent/models/CloudServiceInner.java | 70 + .../models/CloudServiceInstanceViewInner.java | 110 + .../fluent/models/CloudServiceRoleInner.java | 144 + .../models/ComputeOperationValueInner.java | 116 + .../models/DedicatedHostGroupInner.java | 182 + .../fluent/models/DedicatedHostInner.java | 258 + .../fluent/models/DiskAccessInner.java | 94 + .../fluent/models/DiskEncryptionSetInner.java | 214 + .../generated/fluent/models/DiskInner.java | 830 +++ .../fluent/models/DiskRestorePointInner.java | 212 + .../models/GalleryApplicationInner.java | 213 + .../GalleryApplicationVersionInner.java | 108 + .../fluent/models/GalleryImageInner.java | 443 ++ .../models/GalleryImageVersionInner.java | 137 + .../generated/fluent/models/GalleryInner.java | 145 + .../generated/fluent/models/ImageInner.java | 184 + .../LogAnalyticsOperationResultInner.java | 43 + .../fluent/models/OSFamilyInner.java | 114 + .../fluent/models/OSVersionInner.java | 114 + .../PrivateEndpointConnectionInner.java | 96 + .../PrivateLinkResourceListResultInner.java | 55 + .../models/ProximityPlacementGroupInner.java | 167 + .../models/RecoveryWalkResponseInner.java | 56 + .../fluent/models/ResourceSkuInner.java | 246 + .../models/RestorePointCollectionInner.java | 125 + .../fluent/models/RestorePointInner.java | 135 + ...etrieveBootDiagnosticsDataResultInner.java | 54 + .../fluent/models/RoleInstanceInner.java | 159 + .../models/RoleInstancePropertiesInner.java | 83 + .../fluent/models/RoleInstanceViewInner.java | 94 + .../models/RollingUpgradeStatusInfoInner.java | 119 + .../models/RunCommandDocumentBaseInner.java | 184 + .../models/RunCommandDocumentInner.java | 124 + .../fluent/models/RunCommandResultInner.java | 55 + .../models/SharedGalleryImageInner.java | 314 + .../SharedGalleryImageVersionInner.java | 97 + .../fluent/models/SharedGalleryInner.java | 33 + .../fluent/models/SharingUpdateInner.java | 94 + .../fluent/models/SnapshotInner.java | 535 ++ ...shPublicKeyGenerateKeyPairResultInner.java | 130 + .../models/SshPublicKeyResourceInner.java | 78 + .../fluent/models/UpdateDomainInner.java | 54 + ...adeOperationHistoricalStatusInfoInner.java | 73 + .../generated/fluent/models/UsageInner.java | 141 + ...irtualMachineAssessPatchesResultInner.java | 169 + .../VirtualMachineCaptureResultInner.java | 93 + .../VirtualMachineExtensionImageInner.java | 182 + .../models/VirtualMachineExtensionInner.java | 312 + ...rtualMachineExtensionsListResultInner.java | 54 + .../models/VirtualMachineImageInner.java | 276 + .../VirtualMachineImageResourceInner.java | 159 + .../fluent/models/VirtualMachineInner.java | 978 +++ ...rtualMachineInstallPatchesResultInner.java | 235 + .../VirtualMachineInstanceViewInner.java | 465 ++ .../models/VirtualMachineRunCommandInner.java | 328 + .../VirtualMachineScaleSetExtensionInner.java | 341 + .../models/VirtualMachineScaleSetInner.java | 662 ++ ...rtualMachineScaleSetInstanceViewInner.java | 112 + .../VirtualMachineScaleSetSkuInner.java | 77 + ...irtualMachineScaleSetVMExtensionInner.java | 329 + ...neScaleSetVMExtensionsListResultInner.java | 56 + .../models/VirtualMachineScaleSetVMInner.java | 649 ++ ...ualMachineScaleSetVMInstanceViewInner.java | 360 + .../models/VirtualMachineSizeInner.java | 193 + .../models/VirtualMachineUpdateInner.java | 925 +++ .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/AccessUriImpl.java | 32 + .../implementation/AvailabilitySetImpl.java | 262 + .../AvailabilitySetsClientImpl.java | 1476 ++++ .../implementation/AvailabilitySetsImpl.java | 194 + .../CapacityReservationGroupImpl.java | 221 + .../CapacityReservationGroupsClientImpl.java | 1485 ++++ .../CapacityReservationGroupsImpl.java | 200 + .../CapacityReservationImpl.java | 260 + .../CapacityReservationsClientImpl.java | 1682 +++++ .../CapacityReservationsImpl.java | 239 + .../implementation/CloudServiceImpl.java | 245 + .../CloudServiceInstanceViewImpl.java | 59 + ...loudServiceOperatingSystemsClientImpl.java | 934 +++ .../CloudServiceOperatingSystemsImpl.java | 106 + .../implementation/CloudServiceRoleImpl.java | 54 + .../CloudServiceRoleInstancesClientImpl.java | 2131 ++++++ .../CloudServiceRoleInstancesImpl.java | 158 + .../CloudServiceRolesClientImpl.java | 530 ++ .../implementation/CloudServiceRolesImpl.java | 74 + .../CloudServicesClientImpl.java | 3537 +++++++++ .../implementation/CloudServicesImpl.java | 262 + .../CloudServicesUpdateDomainsClientImpl.java | 896 +++ .../CloudServicesUpdateDomainsImpl.java | 97 + .../ComputeManagementClientBuilder.java | 149 + .../ComputeManagementClientImpl.java | 915 +++ .../ComputeOperationValueImpl.java | 53 + .../DedicatedHostGroupImpl.java | 242 + .../DedicatedHostGroupsClientImpl.java | 1302 ++++ .../DedicatedHostGroupsImpl.java | 176 + .../implementation/DedicatedHostImpl.java | 259 + .../DedicatedHostsClientImpl.java | 1480 ++++ .../implementation/DedicatedHostsImpl.java | 193 + .../implementation/DiskAccessImpl.java | 197 + .../DiskAccessesClientImpl.java | 2996 ++++++++ .../implementation/DiskAccessesImpl.java | 298 + .../implementation/DiskEncryptionSetImpl.java | 249 + .../DiskEncryptionSetsClientImpl.java | 1978 +++++ .../DiskEncryptionSetsImpl.java | 190 + .../generated/implementation/DiskImpl.java | 516 ++ .../implementation/DiskRestorePointImpl.java | 81 + .../DiskRestorePointsClientImpl.java | 1470 ++++ .../implementation/DiskRestorePointsImpl.java | 164 + .../implementation/DisksClientImpl.java | 2088 ++++++ .../generated/implementation/DisksImpl.java | 199 + .../implementation/GalleriesClientImpl.java | 1574 ++++ .../implementation/GalleriesImpl.java | 174 + .../GalleryApplicationImpl.java | 263 + .../GalleryApplicationVersionImpl.java | 247 + .../GalleryApplicationVersionsClientImpl.java | 1961 +++++ .../GalleryApplicationVersionsImpl.java | 271 + .../GalleryApplicationsClientImpl.java | 1598 ++++ .../GalleryApplicationsImpl.java | 193 + .../implementation/GalleryImageImpl.java | 376 + .../GalleryImageVersionImpl.java | 255 + .../GalleryImageVersionsClientImpl.java | 1790 +++++ .../GalleryImageVersionsImpl.java | 245 + .../GalleryImagesClientImpl.java | 1490 ++++ .../implementation/GalleryImagesImpl.java | 189 + .../generated/implementation/GalleryImpl.java | 221 + .../GallerySharingProfilesClientImpl.java | 343 + .../GallerySharingProfilesImpl.java | 55 + .../generated/implementation/ImageImpl.java | 227 + .../implementation/ImagesClientImpl.java | 1551 ++++ .../generated/implementation/ImagesImpl.java | 171 + .../LogAnalyticsClientImpl.java | 608 ++ .../implementation/LogAnalyticsImpl.java | 78 + .../LogAnalyticsOperationResultImpl.java | 34 + .../implementation/OSFamilyImpl.java | 48 + .../implementation/OSVersionImpl.java | 49 + .../implementation/OperationsClientImpl.java | 177 + .../implementation/OperationsImpl.java | 46 + .../PrivateEndpointConnectionImpl.java | 56 + .../PrivateLinkResourceListResultImpl.java | 41 + .../ProximityPlacementGroupImpl.java | 232 + .../ProximityPlacementGroupsClientImpl.java | 1329 ++++ .../ProximityPlacementGroupsImpl.java | 196 + .../RecoveryWalkResponseImpl.java | 37 + .../implementation/ResourceSkuImpl.java | 117 + .../ResourceSkusClientImpl.java | 314 + .../implementation/ResourceSkusImpl.java | 46 + .../RestorePointCollectionImpl.java | 222 + .../RestorePointCollectionsClientImpl.java | 1454 ++++ .../RestorePointCollectionsImpl.java | 195 + .../implementation/RestorePointImpl.java | 135 + .../RestorePointsClientImpl.java | 882 +++ .../implementation/RestorePointsImpl.java | 195 + ...RetrieveBootDiagnosticsDataResultImpl.java | 37 + .../implementation/RoleInstanceImpl.java | 71 + .../RoleInstancePropertiesImpl.java | 45 + .../implementation/RoleInstanceViewImpl.java | 52 + .../RollingUpgradeStatusInfoImpl.java | 76 + .../RunCommandDocumentBaseImpl.java | 50 + .../RunCommandDocumentImpl.java | 71 + .../implementation/RunCommandResultImpl.java | 40 + .../SharedGalleriesClientImpl.java | 507 ++ .../implementation/SharedGalleriesImpl.java | 71 + .../SharedGalleryImageImpl.java | 93 + .../SharedGalleryImageVersionImpl.java | 50 + .../SharedGalleryImageVersionsClientImpl.java | 625 ++ .../SharedGalleryImageVersionsImpl.java | 86 + .../SharedGalleryImagesClientImpl.java | 556 ++ .../SharedGalleryImagesImpl.java | 76 + .../implementation/SharedGalleryImpl.java | 40 + .../implementation/SharingUpdateImpl.java | 45 + .../implementation/SnapshotImpl.java | 379 + .../implementation/SnapshotsClientImpl.java | 2099 ++++++ .../implementation/SnapshotsImpl.java | 201 + ...SshPublicKeyGenerateKeyPairResultImpl.java | 41 + .../SshPublicKeyResourceImpl.java | 200 + .../SshPublicKeysClientImpl.java | 1442 ++++ .../implementation/SshPublicKeysImpl.java | 198 + .../implementation/UpdateDomainImpl.java | 36 + ...radeOperationHistoricalStatusInfoImpl.java | 42 + .../generated/implementation/UsageImpl.java | 44 + .../implementation/UsagesClientImpl.java | 313 + .../generated/implementation/UsagesImpl.java | 46 + .../generated/implementation/Utils.java | 204 + ...VirtualMachineAssessPatchesResultImpl.java | 72 + .../VirtualMachineCaptureResultImpl.java | 56 + .../VirtualMachineExtensionImageImpl.java | 76 + ...rtualMachineExtensionImagesClientImpl.java | 662 ++ .../VirtualMachineExtensionImagesImpl.java | 138 + .../VirtualMachineExtensionImpl.java | 305 + .../VirtualMachineExtensionsClientImpl.java | 1447 ++++ .../VirtualMachineExtensionsImpl.java | 209 + ...irtualMachineExtensionsListResultImpl.java | 48 + .../VirtualMachineImageImpl.java | 103 + .../VirtualMachineImageResourceImpl.java | 57 + .../VirtualMachineImagesClientImpl.java | 1014 +++ ...rtualMachineImagesEdgeZonesClientImpl.java | 1139 +++ .../VirtualMachineImagesEdgeZonesImpl.java | 222 + .../VirtualMachineImagesImpl.java | 205 + .../implementation/VirtualMachineImpl.java | 727 ++ ...irtualMachineInstallPatchesResultImpl.java | 89 + .../VirtualMachineInstanceViewImpl.java | 119 + .../VirtualMachineRunCommandImpl.java | 327 + .../VirtualMachineRunCommandsClientImpl.java | 1936 +++++ .../VirtualMachineRunCommandsImpl.java | 239 + .../VirtualMachineScaleSetExtensionImpl.java | 280 + ...alMachineScaleSetExtensionsClientImpl.java | 1552 ++++ .../VirtualMachineScaleSetExtensionsImpl.java | 209 + .../VirtualMachineScaleSetImpl.java | 597 ++ ...irtualMachineScaleSetInstanceViewImpl.java | 66 + ...hineScaleSetRollingUpgradesClientImpl.java | 985 +++ ...ualMachineScaleSetRollingUpgradesImpl.java | 86 + .../VirtualMachineScaleSetSkuImpl.java | 43 + ...VirtualMachineScaleSetVMExtensionImpl.java | 278 + ...MachineScaleSetVMExtensionsClientImpl.java | 1606 ++++ ...irtualMachineScaleSetVMExtensionsImpl.java | 263 + ...ineScaleSetVMExtensionsListResultImpl.java | 49 + .../VirtualMachineScaleSetVMImpl.java | 182 + ...tualMachineScaleSetVMInstanceViewImpl.java | 101 + ...achineScaleSetVMRunCommandsClientImpl.java | 1690 +++++ ...rtualMachineScaleSetVMRunCommandsImpl.java | 164 + .../VirtualMachineScaleSetVMsClientImpl.java | 4533 +++++++++++ .../VirtualMachineScaleSetVMsImpl.java | 308 + .../VirtualMachineScaleSetsClientImpl.java | 6631 +++++++++++++++++ .../VirtualMachineScaleSetsImpl.java | 503 ++ .../VirtualMachineSizeImpl.java | 53 + .../VirtualMachineSizesClientImpl.java | 216 + .../VirtualMachineSizesImpl.java | 47 + .../VirtualMachineUpdateImpl.java | 176 + .../VirtualMachinesClientImpl.java | 6283 ++++++++++++++++ .../implementation/VirtualMachinesImpl.java | 455 ++ .../implementation/package-info.java | 6 + .../compute/generated/models/AccessLevel.java | 37 + .../compute/generated/models/AccessUri.java | 24 + .../models/AdditionalCapabilities.java | 58 + .../models/AdditionalUnattendContent.java | 144 + .../models/AggregatedReplicationState.java | 40 + .../generated/models/ApiEntityReference.java | 53 + .../compute/generated/models/ApiError.java | 43 + .../generated/models/ApiErrorException.java | 37 + .../models/AutomaticOSUpgradePolicy.java | 92 + .../models/AutomaticOSUpgradeProperties.java | 50 + .../models/AutomaticRepairsPolicy.java | 90 + .../generated/models/AvailabilitySet.java | 361 + .../models/AvailabilitySetListResult.java | 88 + .../models/AvailabilitySetUpdate.java | 196 + .../generated/models/AvailabilitySets.java | 187 + .../models/AvailablePatchSummary.java | 161 + .../generated/models/BillingProfile.java | 84 + .../generated/models/BootDiagnostics.java | 84 + .../models/BootDiagnosticsInstanceView.java | 79 + .../generated/models/CachingTypes.java | 50 + .../generated/models/CapacityReservation.java | 303 + .../models/CapacityReservationGroup.java | 240 + .../CapacityReservationGroupInstanceView.java | 45 + ...cityReservationGroupInstanceViewTypes.java | 32 + .../CapacityReservationGroupListResult.java | 90 + .../CapacityReservationGroupUpdate.java | 98 + .../models/CapacityReservationGroups.java | 205 + .../CapacityReservationInstanceView.java | 86 + .../CapacityReservationInstanceViewTypes.java | 32 + ...pacityReservationInstanceViewWithName.java | 59 + .../models/CapacityReservationListResult.java | 89 + .../models/CapacityReservationProfile.java | 58 + .../models/CapacityReservationUpdate.java | 163 + .../CapacityReservationUtilization.java | 45 + .../models/CapacityReservations.java | 177 + .../generated/models/CloudService.java | 385 + .../models/CloudServiceExtensionProfile.java | 54 + .../CloudServiceExtensionProperties.java | 326 + .../models/CloudServiceInstanceView.java | 48 + .../models/CloudServiceListResult.java | 85 + .../models/CloudServiceNetworkProfile.java | 93 + .../models/CloudServiceOperatingSystems.java | 132 + .../models/CloudServiceOsProfile.java | 55 + .../models/CloudServiceProperties.java | 377 + .../generated/models/CloudServiceRole.java | 59 + .../models/CloudServiceRoleInstances.java | 252 + .../models/CloudServiceRoleListResult.java | 86 + .../models/CloudServiceRoleProfile.java | 54 + .../CloudServiceRoleProfileProperties.java | 79 + .../models/CloudServiceRoleProperties.java | 39 + .../generated/models/CloudServiceRoleSku.java | 109 + .../generated/models/CloudServiceRoles.java | 71 + .../generated/models/CloudServiceUpdate.java | 51 + .../models/CloudServiceUpgradeMode.java | 37 + .../CloudServiceVaultAndSecretReference.java | 77 + .../models/CloudServiceVaultCertificate.java | 56 + .../models/CloudServiceVaultSecretGroup.java | 85 + .../generated/models/CloudServices.java | 416 ++ .../models/CloudServicesUpdateDomains.java | 125 + .../generated/models/ComponentNames.java | 44 + .../models/ComputeOperationListResult.java | 44 + .../models/ComputeOperationValue.java | 59 + .../models/ConsistencyModeTypes.java | 37 + .../generated/models/CreationData.java | 282 + .../compute/generated/models/DataDisk.java | 467 ++ .../generated/models/DataDiskImage.java | 42 + .../models/DataDiskImageEncryption.java | 66 + .../generated/models/DedicatedHost.java | 363 + .../models/DedicatedHostAllocatableVM.java | 79 + .../DedicatedHostAvailableCapacity.java | 57 + .../generated/models/DedicatedHostGroup.java | 322 + .../DedicatedHostGroupInstanceView.java | 55 + .../models/DedicatedHostGroupListResult.java | 89 + .../models/DedicatedHostGroupUpdate.java | 173 + .../generated/models/DedicatedHostGroups.java | 168 + .../models/DedicatedHostInstanceView.java | 100 + .../DedicatedHostInstanceViewWithName.java | 59 + .../models/DedicatedHostLicenseTypes.java | 50 + .../models/DedicatedHostListResult.java | 88 + .../generated/models/DedicatedHostUpdate.java | 211 + .../generated/models/DedicatedHosts.java | 148 + .../generated/models/DeleteOptions.java | 34 + .../generated/models/DiagnosticsProfile.java | 60 + .../generated/models/DiffDiskOptions.java | 31 + .../generated/models/DiffDiskPlacement.java | 34 + .../generated/models/DiffDiskSettings.java | 97 + .../compute/generated/models/Disallowed.java | 51 + .../models/DisallowedConfiguration.java | 50 + .../compute/generated/models/Disk.java | 939 +++ .../compute/generated/models/DiskAccess.java | 216 + .../generated/models/DiskAccessList.java | 88 + .../generated/models/DiskAccessUpdate.java | 51 + .../generated/models/DiskAccesses.java | 356 + .../generated/models/DiskCreateOption.java | 49 + .../models/DiskCreateOptionTypes.java | 37 + .../models/DiskDeleteOptionTypes.java | 34 + .../models/DiskDetachOptionTypes.java | 31 + .../generated/models/DiskEncryptionSet.java | 345 + .../models/DiskEncryptionSetIdentityType.java | 34 + .../models/DiskEncryptionSetList.java | 88 + .../models/DiskEncryptionSetParameters.java | 35 + .../models/DiskEncryptionSetType.java | 36 + .../models/DiskEncryptionSetUpdate.java | 172 + .../generated/models/DiskEncryptionSets.java | 208 + .../models/DiskEncryptionSettings.java | 112 + .../generated/models/DiskImageEncryption.java | 50 + .../generated/models/DiskInstanceView.java | 112 + .../compute/generated/models/DiskList.java | 87 + .../generated/models/DiskRestorePoint.java | 104 + .../models/DiskRestorePointList.java | 88 + .../generated/models/DiskRestorePoints.java | 187 + .../generated/models/DiskSecurityProfile.java | 50 + .../generated/models/DiskSecurityTypes.java | 31 + .../compute/generated/models/DiskSku.java | 67 + .../compute/generated/models/DiskState.java | 46 + .../models/DiskStorageAccountTypes.java | 46 + .../compute/generated/models/DiskUpdate.java | 547 ++ .../compute/generated/models/Disks.java | 213 + .../compute/generated/models/Encryption.java | 79 + .../generated/models/EncryptionImages.java | 85 + .../models/EncryptionSetIdentity.java | 100 + .../models/EncryptionSettingsCollection.java | 120 + .../models/EncryptionSettingsElement.java | 86 + .../generated/models/EncryptionType.java | 40 + .../generated/models/ExecutionState.java | 49 + ...dTypesForGetCapacityReservationGroups.java | 37 + .../models/ExpandTypesForGetVMScaleSets.java | 31 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationTypes.java | 31 + .../compute/generated/models/Extension.java | 79 + .../compute/generated/models/Galleries.java | 170 + .../compute/generated/models/Gallery.java | 290 + .../generated/models/GalleryApplication.java | 391 + .../models/GalleryApplicationList.java | 89 + .../models/GalleryApplicationUpdate.java | 206 + .../models/GalleryApplicationVersion.java | 238 + .../models/GalleryApplicationVersionList.java | 90 + ...ionVersionPropertiesProvisioningState.java | 47 + ...ryApplicationVersionPublishingProfile.java | 152 + .../GalleryApplicationVersionUpdate.java | 99 + .../models/GalleryApplicationVersions.java | 186 + .../generated/models/GalleryApplications.java | 158 + .../GalleryArtifactPublishingProfileBase.java | 190 + .../models/GalleryArtifactVersionSource.java | 80 + .../models/GalleryDataDiskImage.java | 73 + .../generated/models/GalleryDiskImage.java | 95 + .../generated/models/GalleryIdentifier.java | 41 + .../generated/models/GalleryImage.java | 617 ++ .../generated/models/GalleryImageFeature.java | 76 + .../models/GalleryImageIdentifier.java | 118 + .../generated/models/GalleryImageList.java | 89 + ...lleryImagePropertiesProvisioningState.java | 47 + .../generated/models/GalleryImageUpdate.java | 428 ++ .../generated/models/GalleryImageVersion.java | 267 + .../models/GalleryImageVersionList.java | 88 + ...ageVersionPropertiesProvisioningState.java | 47 + .../GalleryImageVersionPublishingProfile.java | 62 + .../GalleryImageVersionStorageProfile.java | 112 + .../models/GalleryImageVersionUpdate.java | 127 + .../models/GalleryImageVersions.java | 175 + .../generated/models/GalleryImages.java | 152 + .../compute/generated/models/GalleryList.java | 88 + .../generated/models/GalleryOSDiskImage.java | 39 + .../GalleryPropertiesProvisioningState.java | 46 + .../models/GallerySharingPermissionTypes.java | 34 + .../models/GallerySharingProfiles.java | 41 + .../generated/models/GalleryUpdate.java | 136 + .../generated/models/GrantAccessData.java | 81 + .../generated/models/HardwareProfile.java | 80 + .../compute/generated/models/HostCaching.java | 50 + .../generated/models/HyperVGeneration.java | 34 + .../models/HyperVGenerationType.java | 34 + .../models/HyperVGenerationTypes.java | 34 + .../compute/generated/models/Image.java | 322 + .../generated/models/ImageDataDisk.java | 106 + .../compute/generated/models/ImageDisk.java | 229 + .../generated/models/ImageDiskReference.java | 86 + .../generated/models/ImageListResult.java | 88 + .../compute/generated/models/ImageOSDisk.java | 144 + .../generated/models/ImagePurchasePlan.java | 102 + .../generated/models/ImageReference.java | 175 + .../generated/models/ImageStorageProfile.java | 127 + .../compute/generated/models/ImageUpdate.java | 143 + .../compute/generated/models/Images.java | 160 + .../compute/generated/models/InnerError.java | 76 + .../compute/generated/models/InstanceSku.java | 54 + .../generated/models/InstanceViewStatus.java | 155 + .../models/InstanceViewStatusesSummary.java | 43 + .../generated/models/InstanceViewTypes.java | 47 + .../generated/models/IntervalInMins.java | 53 + .../compute/generated/models/IpVersion.java | 34 + .../compute/generated/models/IpVersions.java | 34 + .../models/KeyForDiskEncryptionSet.java | 92 + .../models/KeyVaultAndKeyReference.java | 89 + .../models/KeyVaultAndSecretReference.java | 90 + .../models/KeyVaultKeyReference.java | 88 + .../models/KeyVaultSecretReference.java | 89 + .../models/LastPatchInstallationSummary.java | 209 + .../generated/models/LinuxConfiguration.java | 149 + .../generated/models/LinuxParameters.java | 141 + .../models/LinuxPatchAssessmentMode.java | 34 + .../generated/models/LinuxPatchSettings.java | 100 + .../models/LinuxVMGuestPatchMode.java | 34 + .../generated/models/ListUsagesResult.java | 89 + .../models/LoadBalancerConfiguration.java | 115 + .../LoadBalancerConfigurationProperties.java | 67 + .../LoadBalancerFrontendIpConfiguration.java | 95 + ...ncerFrontendIpConfigurationProperties.java | 104 + .../generated/models/LogAnalytics.java | 64 + .../models/LogAnalyticsInputBase.java | 252 + .../models/LogAnalyticsOperationResult.java | 24 + .../generated/models/LogAnalyticsOutput.java | 39 + .../MaintenanceOperationResultCodeTypes.java | 53 + .../models/MaintenanceRedeployStatus.java | 209 + .../generated/models/ManagedArtifact.java | 55 + .../models/ManagedDiskParameters.java | 94 + .../generated/models/NetworkAccessPolicy.java | 37 + .../generated/models/NetworkApiVersion.java | 31 + .../models/NetworkInterfaceReference.java | 89 + .../generated/models/NetworkProfile.java | 119 + .../compute/generated/models/OSDisk.java | 422 ++ .../compute/generated/models/OSDiskImage.java | 55 + .../models/OSDiskImageEncryption.java | 32 + .../compute/generated/models/OSFamily.java | 52 + .../generated/models/OSFamilyListResult.java | 85 + .../generated/models/OSFamilyProperties.java | 73 + .../compute/generated/models/OSProfile.java | 384 + .../compute/generated/models/OSVersion.java | 52 + .../generated/models/OSVersionListResult.java | 85 + .../generated/models/OSVersionProperties.java | 114 + .../models/OSVersionPropertiesBase.java | 84 + .../models/OperatingSystemStateTypes.java | 47 + .../generated/models/OperatingSystemType.java | 34 + .../models/OperatingSystemTypes.java | 47 + .../compute/generated/models/Operations.java | 31 + .../generated/models/OrchestrationMode.java | 34 + .../models/OrchestrationServiceNames.java | 31 + .../models/OrchestrationServiceState.java | 37 + .../OrchestrationServiceStateAction.java | 34 + .../OrchestrationServiceStateInput.java | 88 + .../models/OrchestrationServiceSummary.java | 54 + .../compute/generated/models/PassNames.java | 44 + .../models/PatchAssessmentState.java | 34 + .../models/PatchInstallationDetail.java | 117 + .../models/PatchInstallationState.java | 46 + .../models/PatchOperationStatus.java | 43 + .../generated/models/PatchSettings.java | 143 + .../compute/generated/models/PirResource.java | 54 + .../models/PirSharedGalleryResource.java | 54 + .../compute/generated/models/Plan.java | 136 + .../generated/models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 60 + .../PrivateEndpointConnectionListResult.java | 84 + ...teEndpointConnectionProvisioningState.java | 41 + ...rivateEndpointServiceConnectionStatus.java | 38 + .../generated/models/PrivateLinkResource.java | 128 + .../models/PrivateLinkResourceListResult.java | 26 + .../PrivateLinkServiceConnectionState.java | 108 + .../models/PropertyUpdatesInProgress.java | 51 + .../generated/models/ProtocolTypes.java | 47 + .../models/ProximityPlacementGroup.java | 259 + .../ProximityPlacementGroupListResult.java | 86 + .../models/ProximityPlacementGroupType.java | 34 + .../models/ProximityPlacementGroupUpdate.java | 33 + .../models/ProximityPlacementGroups.java | 162 + .../generated/models/ProxyOnlyResource.java | 69 + .../generated/models/PublicIpAddressSku.java | 76 + .../models/PublicIpAddressSkuName.java | 34 + .../models/PublicIpAddressSkuTier.java | 34 + .../models/PublicIpAllocationMethod.java | 34 + .../generated/models/PurchasePlan.java | 120 + .../models/PurchasePlanAutoGenerated.java | 148 + .../RecommendedMachineConfiguration.java | 85 + .../models/RecoveryWalkResponse.java | 32 + .../models/RegionalReplicationStatus.java | 84 + .../generated/models/ReplicationState.java | 40 + .../generated/models/ReplicationStatus.java | 60 + .../models/ReplicationStatusTypes.java | 31 + .../models/RequestRateByIntervalInput.java | 115 + .../models/ResourceIdentityType.java | 53 + .../models/ResourceInstanceViewStatus.java | 111 + .../generated/models/ResourceRange.java | 76 + .../compute/generated/models/ResourceSku.java | 112 + .../models/ResourceSkuCapabilities.java | 54 + .../generated/models/ResourceSkuCapacity.java | 84 + .../models/ResourceSkuCapacityScaleType.java | 50 + .../generated/models/ResourceSkuCosts.java | 69 + .../models/ResourceSkuLocationInfo.java | 73 + .../models/ResourceSkuRestrictionInfo.java | 55 + .../models/ResourceSkuRestrictions.java | 90 + .../ResourceSkuRestrictionsReasonCode.java | 47 + .../models/ResourceSkuRestrictionsType.java | 47 + .../models/ResourceSkuZoneDetails.java | 61 + .../generated/models/ResourceSkus.java | 32 + .../generated/models/ResourceSkusResult.java | 88 + .../generated/models/ResourceUriList.java | 86 + .../generated/models/RestorePoint.java | 146 + .../models/RestorePointCollection.java | 245 + .../RestorePointCollectionExpandOptions.java | 32 + .../RestorePointCollectionListResult.java | 84 + ...estorePointCollectionSourceProperties.java | 67 + .../models/RestorePointCollectionUpdate.java | 119 + .../models/RestorePointCollections.java | 184 + .../RestorePointProvisioningDetails.java | 132 + .../models/RestorePointSourceMetadata.java | 251 + .../models/RestorePointSourceVMDataDisk.java | 189 + .../RestorePointSourceVMStorageProfile.java | 85 + .../models/RestorePointSourceVmosDisk.java | 215 + .../generated/models/RestorePoints.java | 124 + .../RetrieveBootDiagnosticsDataResult.java | 32 + .../generated/models/RoleInstance.java | 67 + .../models/RoleInstanceListResult.java | 85 + .../models/RoleInstanceNetworkProfile.java | 43 + .../models/RoleInstanceProperties.java | 31 + .../generated/models/RoleInstanceView.java | 48 + .../generated/models/RoleInstances.java | 59 + .../generated/models/RollbackStatusInfo.java | 73 + .../models/RollingUpgradeActionType.java | 47 + .../models/RollingUpgradePolicy.java | 221 + .../models/RollingUpgradeProgressInfo.java | 84 + .../models/RollingUpgradeRunningStatus.java | 85 + .../models/RollingUpgradeStatusCode.java | 53 + .../models/RollingUpgradeStatusInfo.java | 81 + .../generated/models/RunCommandDocument.java | 67 + .../models/RunCommandDocumentBase.java | 52 + .../generated/models/RunCommandInput.java | 114 + .../models/RunCommandInputParameter.java | 86 + .../models/RunCommandListResult.java | 88 + .../models/RunCommandParameterDefinition.java | 140 + .../generated/models/RunCommandResult.java | 25 + .../generated/models/ScaleInPolicy.java | 89 + .../models/ScheduledEventsProfile.java | 54 + .../generated/models/SecurityProfile.java | 125 + .../generated/models/SecurityTypes.java | 31 + .../generated/models/SelectPermissions.java | 31 + .../generated/models/SettingNames.java | 47 + .../generated/models/ShareInfoElement.java | 39 + .../generated/models/SharedGalleries.java | 65 + .../generated/models/SharedGallery.java | 38 + .../generated/models/SharedGalleryImage.java | 110 + .../models/SharedGalleryImageList.java | 88 + .../models/SharedGalleryImageVersion.java | 55 + .../models/SharedGalleryImageVersionList.java | 90 + .../models/SharedGalleryImageVersions.java | 88 + .../generated/models/SharedGalleryImages.java | 73 + .../generated/models/SharedGalleryList.java | 88 + .../generated/models/SharedToValues.java | 31 + .../generated/models/SharingProfile.java | 72 + .../generated/models/SharingProfileGroup.java | 80 + .../models/SharingProfileGroupTypes.java | 34 + .../generated/models/SharingUpdate.java | 34 + .../models/SharingUpdateOperationTypes.java | 37 + .../compute/generated/models/Sku.java | 108 + .../compute/generated/models/Snapshot.java | 651 ++ .../generated/models/SnapshotList.java | 88 + .../compute/generated/models/SnapshotSku.java | 68 + .../models/SnapshotStorageAccountTypes.java | 37 + .../generated/models/SnapshotUpdate.java | 293 + .../compute/generated/models/Snapshots.java | 214 + .../compute/generated/models/SourceVault.java | 53 + .../generated/models/SpotRestorePolicy.java | 87 + .../generated/models/SshConfiguration.java | 54 + .../generated/models/SshPublicKey.java | 92 + .../SshPublicKeyGenerateKeyPairResult.java | 42 + .../models/SshPublicKeyResource.java | 257 + .../models/SshPublicKeyUpdateResource.java | 72 + .../generated/models/SshPublicKeys.java | 190 + .../models/SshPublicKeysGroupListResult.java | 89 + .../generated/models/StatusCodeCount.java | 54 + .../generated/models/StatusLevelTypes.java | 50 + .../generated/models/StorageAccountType.java | 37 + .../generated/models/StorageAccountTypes.java | 46 + .../generated/models/StorageProfile.java | 134 + .../generated/models/SubResourceReadOnly.java | 39 + .../SubResourceWithColocationStatus.java | 62 + .../generated/models/TargetRegion.java | 145 + .../models/TerminateNotificationProfile.java | 83 + .../models/ThrottledRequestsInput.java | 82 + .../generated/models/UefiSettings.java | 85 + .../generated/models/UpdateDomain.java | 31 + .../models/UpdateDomainListResult.java | 85 + .../generated/models/UpdateResource.java | 51 + .../models/UpdateResourceDefinition.java | 52 + .../compute/generated/models/UpgradeMode.java | 50 + .../UpgradeOperationHistoricalStatusInfo.java | 39 + ...erationHistoricalStatusInfoProperties.java | 130 + .../models/UpgradeOperationHistoryStatus.java | 70 + .../models/UpgradeOperationInvoker.java | 50 + .../generated/models/UpgradePolicy.java | 119 + .../generated/models/UpgradeState.java | 53 + .../compute/generated/models/Usage.java | 45 + .../compute/generated/models/UsageName.java | 76 + .../compute/generated/models/Usages.java | 36 + .../generated/models/UserArtifactManage.java | 125 + .../generated/models/UserArtifactSource.java | 85 + .../models/UserAssignedIdentitiesValue.java | 54 + .../VMGuestPatchClassificationLinux.java | 37 + .../VMGuestPatchClassificationWindows.java | 52 + .../models/VMGuestPatchRebootBehavior.java | 40 + .../models/VMGuestPatchRebootSetting.java | 37 + .../models/VMGuestPatchRebootStatus.java | 46 + ...SetConvertToSinglePlacementGroupInput.java | 58 + .../generated/models/VaultCertificate.java | 107 + .../generated/models/VaultSecretGroup.java | 85 + .../generated/models/VirtualHardDisk.java | 50 + .../generated/models/VirtualMachine.java | 1561 ++++ .../VirtualMachineAgentInstanceView.java | 110 + .../VirtualMachineAssessPatchesResult.java | 82 + .../VirtualMachineCaptureParameters.java | 117 + .../models/VirtualMachineCaptureResult.java | 53 + .../VirtualMachineEvictionPolicyTypes.java | 34 + .../models/VirtualMachineExtension.java | 478 ++ ...alMachineExtensionHandlerInstanceView.java | 106 + .../models/VirtualMachineExtensionImage.java | 92 + .../models/VirtualMachineExtensionImages.java | 105 + .../VirtualMachineExtensionInstanceView.java | 162 + .../models/VirtualMachineExtensionUpdate.java | 261 + .../models/VirtualMachineExtensions.java | 145 + .../VirtualMachineExtensionsListResult.java | 26 + .../models/VirtualMachineHealthStatus.java | 42 + .../models/VirtualMachineIdentity.java | 136 + .../generated/models/VirtualMachineImage.java | 105 + .../models/VirtualMachineImageFeature.java | 76 + .../models/VirtualMachineImageResource.java | 55 + .../models/VirtualMachineImages.java | 161 + .../models/VirtualMachineImagesEdgeZones.java | 195 + ...irtualMachineInstallPatchesParameters.java | 151 + .../VirtualMachineInstallPatchesResult.java | 113 + .../models/VirtualMachineInstanceView.java | 134 + .../generated/models/VirtualMachineIpTag.java | 76 + .../models/VirtualMachineListResult.java | 88 + ...lMachineNetworkInterfaceConfiguration.java | 309 + ...workInterfaceDnsSettingsConfiguration.java | 52 + ...achineNetworkInterfaceIpConfiguration.java | 272 + .../models/VirtualMachinePatchStatus.java | 108 + .../models/VirtualMachinePriorityTypes.java | 37 + ...alMachinePublicIpAddressConfiguration.java | 283 + ...blicIpAddressDnsSettingsConfiguration.java | 62 + .../VirtualMachineReimageParameters.java | 54 + .../models/VirtualMachineRunCommand.java | 482 ++ .../VirtualMachineRunCommandInstanceView.java | 237 + .../VirtualMachineRunCommandScriptSource.java | 102 + .../VirtualMachineRunCommandUpdate.java | 319 + .../models/VirtualMachineRunCommands.java | 204 + .../VirtualMachineRunCommandsListResult.java | 86 + .../models/VirtualMachineScaleSet.java | 1121 +++ .../VirtualMachineScaleSetDataDisk.java | 296 + .../VirtualMachineScaleSetExtension.java | 435 ++ ...ualMachineScaleSetExtensionListResult.java | 89 + ...irtualMachineScaleSetExtensionProfile.java | 89 + ...VirtualMachineScaleSetExtensionUpdate.java | 329 + .../VirtualMachineScaleSetExtensions.java | 145 + .../VirtualMachineScaleSetIdentity.java | 136 + ...etIdentityUserAssignedIdentitiesValue.java | 56 + .../VirtualMachineScaleSetInstanceView.java | 47 + ...neScaleSetInstanceViewStatusesSummary.java | 44 + ...VirtualMachineScaleSetIpConfiguration.java | 314 + .../models/VirtualMachineScaleSetIpTag.java | 76 + ...alMachineScaleSetListOSUpgradeHistory.java | 89 + .../VirtualMachineScaleSetListResult.java | 89 + .../VirtualMachineScaleSetListSkusResult.java | 89 + ...tualMachineScaleSetListWithLinkResult.java | 90 + ...lMachineScaleSetManagedDiskParameters.java | 87 + ...alMachineScaleSetNetworkConfiguration.java | 290 + ...aleSetNetworkConfigurationDnsSettings.java | 52 + .../VirtualMachineScaleSetNetworkProfile.java | 123 + .../models/VirtualMachineScaleSetOSDisk.java | 341 + .../VirtualMachineScaleSetOSProfile.java | 294 + ...eScaleSetPublicIpAddressConfiguration.java | 258 + ...blicIpAddressConfigurationDnsSettings.java | 63 + ...rtualMachineScaleSetReimageParameters.java | 66 + ...VirtualMachineScaleSetRollingUpgrades.java | 110 + .../VirtualMachineScaleSetScaleInRules.java | 37 + .../models/VirtualMachineScaleSetSku.java | 38 + .../VirtualMachineScaleSetSkuCapacity.java | 84 + .../VirtualMachineScaleSetSkuScaleType.java | 47 + .../VirtualMachineScaleSetStorageProfile.java | 134 + .../models/VirtualMachineScaleSetUpdate.java | 404 + ...lMachineScaleSetUpdateIpConfiguration.java | 290 + ...ineScaleSetUpdateNetworkConfiguration.java | 282 + ...alMachineScaleSetUpdateNetworkProfile.java | 123 + .../VirtualMachineScaleSetUpdateOSDisk.java | 205 + ...VirtualMachineScaleSetUpdateOSProfile.java | 138 + ...SetUpdatePublicIpAddressConfiguration.java | 137 + ...alMachineScaleSetUpdateStorageProfile.java | 112 + ...VirtualMachineScaleSetUpdateVMProfile.java | 318 + .../models/VirtualMachineScaleSetVM.java | 234 + .../VirtualMachineScaleSetVMExtension.java | 410 + ...rtualMachineScaleSetVMExtensionUpdate.java | 283 + .../VirtualMachineScaleSetVMExtensions.java | 169 + ...MachineScaleSetVMExtensionsListResult.java | 27 + ...ualMachineScaleSetVMExtensionsSummary.java | 58 + .../VirtualMachineScaleSetVMInstanceIDs.java | 57 + ...lMachineScaleSetVMInstanceRequiredIDs.java | 57 + .../VirtualMachineScaleSetVMInstanceView.java | 108 + .../VirtualMachineScaleSetVMListResult.java | 89 + ...ScaleSetVMNetworkProfileConfiguration.java | 56 + .../VirtualMachineScaleSetVMProfile.java | 452 ++ ...tualMachineScaleSetVMProtectionPolicy.java | 83 + ...ualMachineScaleSetVMReimageParameters.java | 32 + .../VirtualMachineScaleSetVMRunCommands.java | 201 + .../models/VirtualMachineScaleSetVMs.java | 533 ++ .../models/VirtualMachineScaleSets.java | 813 ++ .../generated/models/VirtualMachineSize.java | 63 + .../models/VirtualMachineSizeListResult.java | 55 + .../models/VirtualMachineSizeTypes.java | 526 ++ .../generated/models/VirtualMachineSizes.java | 34 + ...VirtualMachineSoftwarePatchProperties.java | 179 + .../models/VirtualMachineStatusCodeCount.java | 54 + .../models/VirtualMachineUpdate.java | 265 + .../generated/models/VirtualMachines.java | 709 ++ .../compute/generated/models/VmDiskTypes.java | 34 + .../generated/models/WinRMConfiguration.java | 54 + .../generated/models/WinRMListener.java | 96 + .../models/WindowsConfiguration.java | 227 + .../generated/models/WindowsParameters.java | 166 + .../models/WindowsPatchAssessmentMode.java | 34 + .../models/WindowsVMGuestPatchMode.java | 37 + .../generated/models/package-info.java | 6 + .../compute/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/compute/ci.yml | 33 + sdk/compute/pom.xml | 53 + 812 files changed, 187436 insertions(+) create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/README.md create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/pom.xml create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GallerySharingProfilesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleriesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineRunCommandsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMExtensionsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMRunCommandsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/LogAnalyticsOperationResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceListResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RetrieveBootDiagnosticsDataResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentBaseInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharingUpdateInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionsListResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageResourceInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstallPatchesResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetSkuInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeOperationValueImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RecoveryWalkResponseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkuImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharingUpdateImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyGenerateKeyPairResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/Utils.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineAssessPatchesResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineCaptureResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsListResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageResourceImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstallPatchesResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetSkuImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMInstanceViewImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesImpl.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessLevel.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessUri.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalCapabilities.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalUnattendContent.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AggregatedReplicationState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiEntityReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiErrorException.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradeProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRole.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleInstances.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfileProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComponentNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationValue.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImageEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHost.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAllocatableVM.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAvailableCapacity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceViewWithName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostLicenseTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DisallowedConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccesses.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskImageEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocation.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPropertiesProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPublishingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplications.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactPublishingProfileBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionSource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDataDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryIdentifier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageFeature.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageIdentifier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImagePropertiesProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPropertiesProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPublishingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryOSDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryPropertiesProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingPermissionTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingProfiles.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GrantAccessData.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HostCaching.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGeneration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDiskReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageOSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImagePurchasePlan.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InnerError.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOperationResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOutput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceRedeployStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedArtifact.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirSharedGalleryResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Plan.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResourceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProxyOnlyResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlanAutoGenerated.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecommendedMachineConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecoveryWalkResponse.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalReplicationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapabilities.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCosts.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointProvisioningDetails.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollbackStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeProgressInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeRunningStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocument.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocumentBase.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandParameterDefinition.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScaleInPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScheduledEventsProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SettingNames.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ShareInfoElement.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleries.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGallery.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedToValues.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroupTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdateOperationTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Sku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotStorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshots.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SourceVault.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceReadOnly.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfo.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoryStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UsageName.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactManage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserAssignedIdentitiesValue.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationLinux.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationWindows.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootBehavior.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootSetting.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMScaleSetConvertToSinglePlacementGroupInput.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualHardDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAssessPatchesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionsListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineHealthStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageFeature.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageResource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommands.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpTag.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListOSUpgradeHistory.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListSkusResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListWithLinkResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetManagedDiskParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetReimageParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetRollingUpgrades.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetScaleInRules.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSku.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuCapacity.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuScaleType.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateIpConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateStorageProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtension.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensions.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsSummary.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceIDs.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceView.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProtectionPolicy.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMReimageParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMRunCommands.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSoftwarePatchProperties.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineStatusCodeCount.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmDiskTypes.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchMode.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/package-info.java create mode 100644 sdk/compute/azure-resourcemanager-compute-generated/src/main/java/module-info.java create mode 100644 sdk/compute/ci.yml create mode 100644 sdk/compute/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 708917304e279..6a69a2a726513 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -308,6 +308,7 @@ com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-compute-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index edd475ba5d02b..c1930bda03f64 100644 --- a/pom.xml +++ b/pom.xml @@ -728,6 +728,7 @@ sdk/cognitiveservices sdk/commerce sdk/communication + sdk/compute sdk/confidentialledger sdk/confluent sdk/consumption diff --git a/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md new file mode 100644 index 0000000000000..f08d4ee1590a4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-22) + +- Azure Resource Manager Compute client library for Java. This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2021-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/compute/azure-resourcemanager-compute-generated/README.md b/sdk/compute/azure-resourcemanager-compute-generated/README.md new file mode 100644 index 0000000000000..89bf5706da383 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager Compute client library for Java + +Azure Resource Manager Compute client library for Java. + +This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2021-04-01. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-compute-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-compute-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +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. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of 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`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ComputeManager manager = ComputeManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +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 + + +[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/ +[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 diff --git a/sdk/compute/azure-resourcemanager-compute-generated/pom.xml b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml new file mode 100644 index 0000000000000..262a7900ba46c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-compute-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Compute Management + This package contains Microsoft Azure SDK for Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Compute Client. Package tag package-2021-04-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java new file mode 100644 index 0000000000000..98ad6c3bce6b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java @@ -0,0 +1,788 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.ComputeManagementClient; +import com.azure.resourcemanager.compute.generated.implementation.AvailabilitySetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceOperatingSystemsImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRoleInstancesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRolesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServicesImpl; +import com.azure.resourcemanager.compute.generated.implementation.CloudServicesUpdateDomainsImpl; +import com.azure.resourcemanager.compute.generated.implementation.ComputeManagementClientBuilder; +import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskAccessesImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskEncryptionSetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DiskRestorePointsImpl; +import com.azure.resourcemanager.compute.generated.implementation.DisksImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleriesImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryImageVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.GalleryImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.GallerySharingProfilesImpl; +import com.azure.resourcemanager.compute.generated.implementation.ImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.LogAnalyticsImpl; +import com.azure.resourcemanager.compute.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.compute.generated.implementation.ProximityPlacementGroupsImpl; +import com.azure.resourcemanager.compute.generated.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.compute.generated.implementation.RestorePointCollectionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.RestorePointsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleriesImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImageVersionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.SnapshotsImpl; +import com.azure.resourcemanager.compute.generated.implementation.SshPublicKeysImpl; +import com.azure.resourcemanager.compute.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesEdgeZonesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineRunCommandsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetRollingUpgradesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMExtensionsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMRunCommandsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetsImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineSizesImpl; +import com.azure.resourcemanager.compute.generated.implementation.VirtualMachinesImpl; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySets; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroups; +import com.azure.resourcemanager.compute.generated.models.CapacityReservations; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOperatingSystems; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleInstances; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoles; +import com.azure.resourcemanager.compute.generated.models.CloudServices; +import com.azure.resourcemanager.compute.generated.models.CloudServicesUpdateDomains; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroups; +import com.azure.resourcemanager.compute.generated.models.DedicatedHosts; +import com.azure.resourcemanager.compute.generated.models.DiskAccesses; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSets; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints; +import com.azure.resourcemanager.compute.generated.models.Disks; +import com.azure.resourcemanager.compute.generated.models.Galleries; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersions; +import com.azure.resourcemanager.compute.generated.models.GalleryApplications; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.GalleryImages; +import com.azure.resourcemanager.compute.generated.models.GallerySharingProfiles; +import com.azure.resourcemanager.compute.generated.models.Images; +import com.azure.resourcemanager.compute.generated.models.LogAnalytics; +import com.azure.resourcemanager.compute.generated.models.Operations; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroups; +import com.azure.resourcemanager.compute.generated.models.ResourceSkus; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollections; +import com.azure.resourcemanager.compute.generated.models.RestorePoints; +import com.azure.resourcemanager.compute.generated.models.SharedGalleries; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImages; +import com.azure.resourcemanager.compute.generated.models.Snapshots; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeys; +import com.azure.resourcemanager.compute.generated.models.Usages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImages; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImagesEdgeZones; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommands; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetRollingUpgrades; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMRunCommands; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSets; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachines; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ComputeManager. Compute Client. */ +public final class ComputeManager { + private Operations operations; + + private AvailabilitySets availabilitySets; + + private ProximityPlacementGroups proximityPlacementGroups; + + private DedicatedHostGroups dedicatedHostGroups; + + private DedicatedHosts dedicatedHosts; + + private SshPublicKeys sshPublicKeys; + + private VirtualMachineExtensionImages virtualMachineExtensionImages; + + private VirtualMachineExtensions virtualMachineExtensions; + + private VirtualMachineImages virtualMachineImages; + + private VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones; + + private Usages usages; + + private VirtualMachines virtualMachines; + + private VirtualMachineScaleSets virtualMachineScaleSets; + + private VirtualMachineSizes virtualMachineSizes; + + private Images images; + + private RestorePointCollections restorePointCollections; + + private RestorePoints restorePoints; + + private CapacityReservationGroups capacityReservationGroups; + + private CapacityReservations capacityReservations; + + private VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions; + + private VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades; + + private VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions; + + private VirtualMachineScaleSetVMs virtualMachineScaleSetVMs; + + private LogAnalytics logAnalytics; + + private VirtualMachineRunCommands virtualMachineRunCommands; + + private VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands; + + private ResourceSkus resourceSkus; + + private Disks disks; + + private Snapshots snapshots; + + private DiskEncryptionSets diskEncryptionSets; + + private DiskAccesses diskAccesses; + + private DiskRestorePoints diskRestorePoints; + + private Galleries galleries; + + private GalleryImages galleryImages; + + private GalleryImageVersions galleryImageVersions; + + private GalleryApplications galleryApplications; + + private GalleryApplicationVersions galleryApplicationVersions; + + private GallerySharingProfiles gallerySharingProfiles; + + private SharedGalleries sharedGalleries; + + private SharedGalleryImages sharedGalleryImages; + + private SharedGalleryImageVersions sharedGalleryImageVersions; + + private CloudServiceRoleInstances cloudServiceRoleInstances; + + private CloudServiceRoles cloudServiceRoles; + + private CloudServices cloudServices; + + private CloudServicesUpdateDomains cloudServicesUpdateDomains; + + private CloudServiceOperatingSystems cloudServiceOperatingSystems; + + private final ComputeManagementClient clientObject; + + private ComputeManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ComputeManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Compute service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute service API instance. + */ + public static ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ComputeManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ComputeManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Compute service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Compute service API instance. + */ + public ComputeManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.compute.generated") + .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)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ComputeManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of AvailabilitySets. */ + public AvailabilitySets availabilitySets() { + if (this.availabilitySets == null) { + this.availabilitySets = new AvailabilitySetsImpl(clientObject.getAvailabilitySets(), this); + } + return availabilitySets; + } + + /** @return Resource collection API of ProximityPlacementGroups. */ + public ProximityPlacementGroups proximityPlacementGroups() { + if (this.proximityPlacementGroups == null) { + this.proximityPlacementGroups = + new ProximityPlacementGroupsImpl(clientObject.getProximityPlacementGroups(), this); + } + return proximityPlacementGroups; + } + + /** @return Resource collection API of DedicatedHostGroups. */ + public DedicatedHostGroups dedicatedHostGroups() { + if (this.dedicatedHostGroups == null) { + this.dedicatedHostGroups = new DedicatedHostGroupsImpl(clientObject.getDedicatedHostGroups(), this); + } + return dedicatedHostGroups; + } + + /** @return Resource collection API of DedicatedHosts. */ + public DedicatedHosts dedicatedHosts() { + if (this.dedicatedHosts == null) { + this.dedicatedHosts = new DedicatedHostsImpl(clientObject.getDedicatedHosts(), this); + } + return dedicatedHosts; + } + + /** @return Resource collection API of SshPublicKeys. */ + public SshPublicKeys sshPublicKeys() { + if (this.sshPublicKeys == null) { + this.sshPublicKeys = new SshPublicKeysImpl(clientObject.getSshPublicKeys(), this); + } + return sshPublicKeys; + } + + /** @return Resource collection API of VirtualMachineExtensionImages. */ + public VirtualMachineExtensionImages virtualMachineExtensionImages() { + if (this.virtualMachineExtensionImages == null) { + this.virtualMachineExtensionImages = + new VirtualMachineExtensionImagesImpl(clientObject.getVirtualMachineExtensionImages(), this); + } + return virtualMachineExtensionImages; + } + + /** @return Resource collection API of VirtualMachineExtensions. */ + public VirtualMachineExtensions virtualMachineExtensions() { + if (this.virtualMachineExtensions == null) { + this.virtualMachineExtensions = + new VirtualMachineExtensionsImpl(clientObject.getVirtualMachineExtensions(), this); + } + return virtualMachineExtensions; + } + + /** @return Resource collection API of VirtualMachineImages. */ + public VirtualMachineImages virtualMachineImages() { + if (this.virtualMachineImages == null) { + this.virtualMachineImages = new VirtualMachineImagesImpl(clientObject.getVirtualMachineImages(), this); + } + return virtualMachineImages; + } + + /** @return Resource collection API of VirtualMachineImagesEdgeZones. */ + public VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones() { + if (this.virtualMachineImagesEdgeZones == null) { + this.virtualMachineImagesEdgeZones = + new VirtualMachineImagesEdgeZonesImpl(clientObject.getVirtualMachineImagesEdgeZones(), this); + } + return virtualMachineImagesEdgeZones; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of VirtualMachines. */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + } + return virtualMachines; + } + + /** @return Resource collection API of VirtualMachineScaleSets. */ + public VirtualMachineScaleSets virtualMachineScaleSets() { + if (this.virtualMachineScaleSets == null) { + this.virtualMachineScaleSets = + new VirtualMachineScaleSetsImpl(clientObject.getVirtualMachineScaleSets(), this); + } + return virtualMachineScaleSets; + } + + /** @return Resource collection API of VirtualMachineSizes. */ + public VirtualMachineSizes virtualMachineSizes() { + if (this.virtualMachineSizes == null) { + this.virtualMachineSizes = new VirtualMachineSizesImpl(clientObject.getVirtualMachineSizes(), this); + } + return virtualMachineSizes; + } + + /** @return Resource collection API of Images. */ + public Images images() { + if (this.images == null) { + this.images = new ImagesImpl(clientObject.getImages(), this); + } + return images; + } + + /** @return Resource collection API of RestorePointCollections. */ + public RestorePointCollections restorePointCollections() { + if (this.restorePointCollections == null) { + this.restorePointCollections = + new RestorePointCollectionsImpl(clientObject.getRestorePointCollections(), this); + } + return restorePointCollections; + } + + /** @return Resource collection API of RestorePoints. */ + public RestorePoints restorePoints() { + if (this.restorePoints == null) { + this.restorePoints = new RestorePointsImpl(clientObject.getRestorePoints(), this); + } + return restorePoints; + } + + /** @return Resource collection API of CapacityReservationGroups. */ + public CapacityReservationGroups capacityReservationGroups() { + if (this.capacityReservationGroups == null) { + this.capacityReservationGroups = + new CapacityReservationGroupsImpl(clientObject.getCapacityReservationGroups(), this); + } + return capacityReservationGroups; + } + + /** @return Resource collection API of CapacityReservations. */ + public CapacityReservations capacityReservations() { + if (this.capacityReservations == null) { + this.capacityReservations = new CapacityReservationsImpl(clientObject.getCapacityReservations(), this); + } + return capacityReservations; + } + + /** @return Resource collection API of VirtualMachineScaleSetExtensions. */ + public VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions() { + if (this.virtualMachineScaleSetExtensions == null) { + this.virtualMachineScaleSetExtensions = + new VirtualMachineScaleSetExtensionsImpl(clientObject.getVirtualMachineScaleSetExtensions(), this); + } + return virtualMachineScaleSetExtensions; + } + + /** @return Resource collection API of VirtualMachineScaleSetRollingUpgrades. */ + public VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades() { + if (this.virtualMachineScaleSetRollingUpgrades == null) { + this.virtualMachineScaleSetRollingUpgrades = + new VirtualMachineScaleSetRollingUpgradesImpl( + clientObject.getVirtualMachineScaleSetRollingUpgrades(), this); + } + return virtualMachineScaleSetRollingUpgrades; + } + + /** @return Resource collection API of VirtualMachineScaleSetVMExtensions. */ + public VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions() { + if (this.virtualMachineScaleSetVMExtensions == null) { + this.virtualMachineScaleSetVMExtensions = + new VirtualMachineScaleSetVMExtensionsImpl(clientObject.getVirtualMachineScaleSetVMExtensions(), this); + } + return virtualMachineScaleSetVMExtensions; + } + + /** @return Resource collection API of VirtualMachineScaleSetVMs. */ + public VirtualMachineScaleSetVMs virtualMachineScaleSetVMs() { + if (this.virtualMachineScaleSetVMs == null) { + this.virtualMachineScaleSetVMs = + new VirtualMachineScaleSetVMsImpl(clientObject.getVirtualMachineScaleSetVMs(), this); + } + return virtualMachineScaleSetVMs; + } + + /** @return Resource collection API of LogAnalytics. */ + public LogAnalytics logAnalytics() { + if (this.logAnalytics == null) { + this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this); + } + return logAnalytics; + } + + /** @return Resource collection API of VirtualMachineRunCommands. */ + public VirtualMachineRunCommands virtualMachineRunCommands() { + if (this.virtualMachineRunCommands == null) { + this.virtualMachineRunCommands = + new VirtualMachineRunCommandsImpl(clientObject.getVirtualMachineRunCommands(), this); + } + return virtualMachineRunCommands; + } + + /** @return Resource collection API of VirtualMachineScaleSetVMRunCommands. */ + public VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands() { + if (this.virtualMachineScaleSetVMRunCommands == null) { + this.virtualMachineScaleSetVMRunCommands = + new VirtualMachineScaleSetVMRunCommandsImpl( + clientObject.getVirtualMachineScaleSetVMRunCommands(), this); + } + return virtualMachineScaleSetVMRunCommands; + } + + /** @return Resource collection API of ResourceSkus. */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); + } + return resourceSkus; + } + + /** @return Resource collection API of Disks. */ + public Disks disks() { + if (this.disks == null) { + this.disks = new DisksImpl(clientObject.getDisks(), this); + } + return disks; + } + + /** @return Resource collection API of Snapshots. */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** @return Resource collection API of DiskEncryptionSets. */ + public DiskEncryptionSets diskEncryptionSets() { + if (this.diskEncryptionSets == null) { + this.diskEncryptionSets = new DiskEncryptionSetsImpl(clientObject.getDiskEncryptionSets(), this); + } + return diskEncryptionSets; + } + + /** @return Resource collection API of DiskAccesses. */ + public DiskAccesses diskAccesses() { + if (this.diskAccesses == null) { + this.diskAccesses = new DiskAccessesImpl(clientObject.getDiskAccesses(), this); + } + return diskAccesses; + } + + /** @return Resource collection API of DiskRestorePoints. */ + public DiskRestorePoints diskRestorePoints() { + if (this.diskRestorePoints == null) { + this.diskRestorePoints = new DiskRestorePointsImpl(clientObject.getDiskRestorePoints(), this); + } + return diskRestorePoints; + } + + /** @return Resource collection API of Galleries. */ + public Galleries galleries() { + if (this.galleries == null) { + this.galleries = new GalleriesImpl(clientObject.getGalleries(), this); + } + return galleries; + } + + /** @return Resource collection API of GalleryImages. */ + public GalleryImages galleryImages() { + if (this.galleryImages == null) { + this.galleryImages = new GalleryImagesImpl(clientObject.getGalleryImages(), this); + } + return galleryImages; + } + + /** @return Resource collection API of GalleryImageVersions. */ + public GalleryImageVersions galleryImageVersions() { + if (this.galleryImageVersions == null) { + this.galleryImageVersions = new GalleryImageVersionsImpl(clientObject.getGalleryImageVersions(), this); + } + return galleryImageVersions; + } + + /** @return Resource collection API of GalleryApplications. */ + public GalleryApplications galleryApplications() { + if (this.galleryApplications == null) { + this.galleryApplications = new GalleryApplicationsImpl(clientObject.getGalleryApplications(), this); + } + return galleryApplications; + } + + /** @return Resource collection API of GalleryApplicationVersions. */ + public GalleryApplicationVersions galleryApplicationVersions() { + if (this.galleryApplicationVersions == null) { + this.galleryApplicationVersions = + new GalleryApplicationVersionsImpl(clientObject.getGalleryApplicationVersions(), this); + } + return galleryApplicationVersions; + } + + /** @return Resource collection API of GallerySharingProfiles. */ + public GallerySharingProfiles gallerySharingProfiles() { + if (this.gallerySharingProfiles == null) { + this.gallerySharingProfiles = + new GallerySharingProfilesImpl(clientObject.getGallerySharingProfiles(), this); + } + return gallerySharingProfiles; + } + + /** @return Resource collection API of SharedGalleries. */ + public SharedGalleries sharedGalleries() { + if (this.sharedGalleries == null) { + this.sharedGalleries = new SharedGalleriesImpl(clientObject.getSharedGalleries(), this); + } + return sharedGalleries; + } + + /** @return Resource collection API of SharedGalleryImages. */ + public SharedGalleryImages sharedGalleryImages() { + if (this.sharedGalleryImages == null) { + this.sharedGalleryImages = new SharedGalleryImagesImpl(clientObject.getSharedGalleryImages(), this); + } + return sharedGalleryImages; + } + + /** @return Resource collection API of SharedGalleryImageVersions. */ + public SharedGalleryImageVersions sharedGalleryImageVersions() { + if (this.sharedGalleryImageVersions == null) { + this.sharedGalleryImageVersions = + new SharedGalleryImageVersionsImpl(clientObject.getSharedGalleryImageVersions(), this); + } + return sharedGalleryImageVersions; + } + + /** @return Resource collection API of CloudServiceRoleInstances. */ + public CloudServiceRoleInstances cloudServiceRoleInstances() { + if (this.cloudServiceRoleInstances == null) { + this.cloudServiceRoleInstances = + new CloudServiceRoleInstancesImpl(clientObject.getCloudServiceRoleInstances(), this); + } + return cloudServiceRoleInstances; + } + + /** @return Resource collection API of CloudServiceRoles. */ + public CloudServiceRoles cloudServiceRoles() { + if (this.cloudServiceRoles == null) { + this.cloudServiceRoles = new CloudServiceRolesImpl(clientObject.getCloudServiceRoles(), this); + } + return cloudServiceRoles; + } + + /** @return Resource collection API of CloudServices. */ + public CloudServices cloudServices() { + if (this.cloudServices == null) { + this.cloudServices = new CloudServicesImpl(clientObject.getCloudServices(), this); + } + return cloudServices; + } + + /** @return Resource collection API of CloudServicesUpdateDomains. */ + public CloudServicesUpdateDomains cloudServicesUpdateDomains() { + if (this.cloudServicesUpdateDomains == null) { + this.cloudServicesUpdateDomains = + new CloudServicesUpdateDomainsImpl(clientObject.getCloudServicesUpdateDomains(), this); + } + return cloudServicesUpdateDomains; + } + + /** @return Resource collection API of CloudServiceOperatingSystems. */ + public CloudServiceOperatingSystems cloudServiceOperatingSystems() { + if (this.cloudServiceOperatingSystems == null) { + this.cloudServiceOperatingSystems = + new CloudServiceOperatingSystemsImpl(clientObject.getCloudServiceOperatingSystems(), this); + } + return cloudServiceOperatingSystems; + } + + /** + * @return Wrapped service client ComputeManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ComputeManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java new file mode 100644 index 0000000000000..c801817d02e75 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.AvailabilitySetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySetUpdate; + +/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */ +public interface AvailabilitySetsClient { + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailabilitySetInner createOrUpdate( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters); + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context); + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailabilitySetInner update(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters); + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context); + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String availabilitySetName); + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context); + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName); + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, Context context); + + /** + * Lists all availability sets 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 List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, Context context); + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes(String resourceGroupName, String availabilitySetName); + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java new file mode 100644 index 0000000000000..45cdc4fea788c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; + +/** An instance of this class provides access to all the operations defined in CapacityReservationGroupsClient. */ +public interface CapacityReservationGroupsClient { + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner createOrUpdate( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters); + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context); + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner update( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters); + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 capacityReservationGroupName); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationGroupInner getByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java new file mode 100644 index 0000000000000..d980191a86c1f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; + +/** An instance of this class provides access to all the operations defined in CapacityReservationsClient. */ +public interface CapacityReservationsClient { + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters); + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters); + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityReservationInner get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java new file mode 100644 index 0000000000000..f3aba1b5938e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; + +/** An instance of this class provides access to all the operations defined in CloudServiceOperatingSystemsClient. */ +public interface CloudServiceOperatingSystemsClient { + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSVersionInner getOSVersion(String location, String osVersionName); + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOSVersionWithResponse(String location, String osVersionName, Context context); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSVersions(String location); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSVersions(String location, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSFamilyInner getOSFamily(String location, String osFamilyName); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOSFamilyWithResponse(String location, String osFamilyName, Context context); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSFamilies(String location); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOSFamilies(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java new file mode 100644 index 0000000000000..6e6422d2674ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.http.rest.StreamResponse; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import java.io.InputStream; + +/** An instance of this class provides access to all the operations defined in CloudServiceRoleInstancesClient. */ +public interface CloudServiceRoleInstancesClient { + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInstanceInner get(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInstanceViewInner getInstanceView(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InputStream getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamResponse getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java new file mode 100644 index 0000000000000..a8ed7e8b96419 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.CloudServiceRoleInner; + +/** An instance of this class provides access to all the operations defined in CloudServiceRolesClient. */ +public interface CloudServiceRolesClient { + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceRoleInner get(String roleName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java new file mode 100644 index 0000000000000..f43ea5689fda1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java @@ -0,0 +1,778 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; + +/** An instance of this class provides access to all the operations defined in CloudServicesClient. */ +public interface CloudServicesClient { + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName, CloudServiceInner parameters); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName); + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner createOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner update(String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner update(String resourceGroupName, String cloudServiceName); + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner update( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInner getByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServiceInstanceViewInner getInstanceView(String resourceGroupName, String cloudServiceName); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 powerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 powerOff(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, RoleInstances parameters); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 deleteInstances(String resourceGroupName, String cloudServiceName); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java new file mode 100644 index 0000000000000..3e46d2deba2f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.UpdateDomainInner; + +/** An instance of this class provides access to all the operations defined in CloudServicesUpdateDomainsClient. */ +public interface CloudServicesUpdateDomainsClient { + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 walkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateDomainInner getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java new file mode 100644 index 0000000000000..7c009e85c454d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ComputeManagementClient class. */ +public interface ComputeManagementClient { + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AvailabilitySetsClient object to access its operations. + * + * @return the AvailabilitySetsClient object. + */ + AvailabilitySetsClient getAvailabilitySets(); + + /** + * Gets the ProximityPlacementGroupsClient object to access its operations. + * + * @return the ProximityPlacementGroupsClient object. + */ + ProximityPlacementGroupsClient getProximityPlacementGroups(); + + /** + * Gets the DedicatedHostGroupsClient object to access its operations. + * + * @return the DedicatedHostGroupsClient object. + */ + DedicatedHostGroupsClient getDedicatedHostGroups(); + + /** + * Gets the DedicatedHostsClient object to access its operations. + * + * @return the DedicatedHostsClient object. + */ + DedicatedHostsClient getDedicatedHosts(); + + /** + * Gets the SshPublicKeysClient object to access its operations. + * + * @return the SshPublicKeysClient object. + */ + SshPublicKeysClient getSshPublicKeys(); + + /** + * Gets the VirtualMachineExtensionImagesClient object to access its operations. + * + * @return the VirtualMachineExtensionImagesClient object. + */ + VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages(); + + /** + * Gets the VirtualMachineExtensionsClient object to access its operations. + * + * @return the VirtualMachineExtensionsClient object. + */ + VirtualMachineExtensionsClient getVirtualMachineExtensions(); + + /** + * Gets the VirtualMachineImagesClient object to access its operations. + * + * @return the VirtualMachineImagesClient object. + */ + VirtualMachineImagesClient getVirtualMachineImages(); + + /** + * Gets the VirtualMachineImagesEdgeZonesClient object to access its operations. + * + * @return the VirtualMachineImagesEdgeZonesClient object. + */ + VirtualMachineImagesEdgeZonesClient getVirtualMachineImagesEdgeZones(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + VirtualMachinesClient getVirtualMachines(); + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + VirtualMachineScaleSetsClient getVirtualMachineScaleSets(); + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + VirtualMachineSizesClient getVirtualMachineSizes(); + + /** + * Gets the ImagesClient object to access its operations. + * + * @return the ImagesClient object. + */ + ImagesClient getImages(); + + /** + * Gets the RestorePointCollectionsClient object to access its operations. + * + * @return the RestorePointCollectionsClient object. + */ + RestorePointCollectionsClient getRestorePointCollections(); + + /** + * Gets the RestorePointsClient object to access its operations. + * + * @return the RestorePointsClient object. + */ + RestorePointsClient getRestorePoints(); + + /** + * Gets the CapacityReservationGroupsClient object to access its operations. + * + * @return the CapacityReservationGroupsClient object. + */ + CapacityReservationGroupsClient getCapacityReservationGroups(); + + /** + * Gets the CapacityReservationsClient object to access its operations. + * + * @return the CapacityReservationsClient object. + */ + CapacityReservationsClient getCapacityReservations(); + + /** + * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations. + * + * @return the VirtualMachineScaleSetExtensionsClient object. + */ + VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions(); + + /** + * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations. + * + * @return the VirtualMachineScaleSetRollingUpgradesClient object. + */ + VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades(); + + /** + * Gets the VirtualMachineScaleSetVMExtensionsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMExtensionsClient object. + */ + VirtualMachineScaleSetVMExtensionsClient getVirtualMachineScaleSetVMExtensions(); + + /** + * Gets the VirtualMachineScaleSetVMsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMsClient object. + */ + VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs(); + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + LogAnalyticsClient getLogAnalytics(); + + /** + * Gets the VirtualMachineRunCommandsClient object to access its operations. + * + * @return the VirtualMachineRunCommandsClient object. + */ + VirtualMachineRunCommandsClient getVirtualMachineRunCommands(); + + /** + * Gets the VirtualMachineScaleSetVMRunCommandsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMRunCommandsClient object. + */ + VirtualMachineScaleSetVMRunCommandsClient getVirtualMachineScaleSetVMRunCommands(); + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + ResourceSkusClient getResourceSkus(); + + /** + * Gets the DisksClient object to access its operations. + * + * @return the DisksClient object. + */ + DisksClient getDisks(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); + + /** + * Gets the DiskEncryptionSetsClient object to access its operations. + * + * @return the DiskEncryptionSetsClient object. + */ + DiskEncryptionSetsClient getDiskEncryptionSets(); + + /** + * Gets the DiskAccessesClient object to access its operations. + * + * @return the DiskAccessesClient object. + */ + DiskAccessesClient getDiskAccesses(); + + /** + * Gets the DiskRestorePointsClient object to access its operations. + * + * @return the DiskRestorePointsClient object. + */ + DiskRestorePointsClient getDiskRestorePoints(); + + /** + * Gets the GalleriesClient object to access its operations. + * + * @return the GalleriesClient object. + */ + GalleriesClient getGalleries(); + + /** + * Gets the GalleryImagesClient object to access its operations. + * + * @return the GalleryImagesClient object. + */ + GalleryImagesClient getGalleryImages(); + + /** + * Gets the GalleryImageVersionsClient object to access its operations. + * + * @return the GalleryImageVersionsClient object. + */ + GalleryImageVersionsClient getGalleryImageVersions(); + + /** + * Gets the GalleryApplicationsClient object to access its operations. + * + * @return the GalleryApplicationsClient object. + */ + GalleryApplicationsClient getGalleryApplications(); + + /** + * Gets the GalleryApplicationVersionsClient object to access its operations. + * + * @return the GalleryApplicationVersionsClient object. + */ + GalleryApplicationVersionsClient getGalleryApplicationVersions(); + + /** + * Gets the GallerySharingProfilesClient object to access its operations. + * + * @return the GallerySharingProfilesClient object. + */ + GallerySharingProfilesClient getGallerySharingProfiles(); + + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + SharedGalleriesClient getSharedGalleries(); + + /** + * Gets the SharedGalleryImagesClient object to access its operations. + * + * @return the SharedGalleryImagesClient object. + */ + SharedGalleryImagesClient getSharedGalleryImages(); + + /** + * Gets the SharedGalleryImageVersionsClient object to access its operations. + * + * @return the SharedGalleryImageVersionsClient object. + */ + SharedGalleryImageVersionsClient getSharedGalleryImageVersions(); + + /** + * Gets the CloudServiceRoleInstancesClient object to access its operations. + * + * @return the CloudServiceRoleInstancesClient object. + */ + CloudServiceRoleInstancesClient getCloudServiceRoleInstances(); + + /** + * Gets the CloudServiceRolesClient object to access its operations. + * + * @return the CloudServiceRolesClient object. + */ + CloudServiceRolesClient getCloudServiceRoles(); + + /** + * Gets the CloudServicesClient object to access its operations. + * + * @return the CloudServicesClient object. + */ + CloudServicesClient getCloudServices(); + + /** + * Gets the CloudServicesUpdateDomainsClient object to access its operations. + * + * @return the CloudServicesUpdateDomainsClient object. + */ + CloudServicesUpdateDomainsClient getCloudServicesUpdateDomains(); + + /** + * Gets the CloudServiceOperatingSystemsClient object to access its operations. + * + * @return the CloudServiceOperatingSystemsClient object. + */ + CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java new file mode 100644 index 0000000000000..334022427fb1e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** An instance of this class provides access to all the operations defined in DedicatedHostGroupsClient. */ +public interface DedicatedHostGroupsClient { + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostGroupInner createOrUpdate( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters); + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context); + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostGroupInner update(String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters); + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context); + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hostGroupName); + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context); + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java new file mode 100644 index 0000000000000..09e89319f8ab7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.DedicatedHostInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; + +/** An instance of this class provides access to all the operations defined in DedicatedHostsClient. */ +public interface DedicatedHostsClient { + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context); + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostInner createOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters); + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostInner createOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context); + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context); + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostInner update( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters); + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostInner update( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context); + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname, Context context); + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 hostGroupName, String hostname); + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 hostGroupName, String hostname, Context context); + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DedicatedHostInner get(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context); + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName); + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java new file mode 100644 index 0000000000000..477c97fc7d6b5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.DiskAccessInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.compute.generated.models.DiskAccessUpdate; + +/** An instance of this class provides access to all the operations defined in DiskAccessesClient. */ +public interface DiskAccessesClient { + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess); + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context); + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskAccessInner createOrUpdate(String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess); + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskAccessInner createOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context); + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess); + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context); + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskAccessInner update(String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess); + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskAccessInner update( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context); + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskAccessInner getByResourceGroup(String resourceGroupName, String diskAccessName); + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, Context context); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName, Context context); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskAccessName); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskAccessName, Context context); + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disk access resources under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disk access resources under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner getPrivateLinkResources(String resourceGroupName, String diskAccessName); + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, Context context); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner getAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName); + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context); + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName); + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java new file mode 100644 index 0000000000000..25e54f4ac6991 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetUpdate; + +/** An instance of this class provides access to all the operations defined in DiskEncryptionSetsClient. */ +public interface DiskEncryptionSetsClient { + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context); + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskEncryptionSetInner createOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet); + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskEncryptionSetInner createOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context); + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context); + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskEncryptionSetInner update( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet); + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskEncryptionSetInner update( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context); + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName); + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, Context context); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String diskEncryptionSetName, Context context); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskEncryptionSetName); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskEncryptionSetName, Context context); + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disk encryption sets under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disk encryption sets under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociatedResources(String resourceGroupName, String diskEncryptionSetName); + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociatedResources( + String resourceGroupName, String diskEncryptionSetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java new file mode 100644 index 0000000000000..7a0a4e74b2324 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** An instance of this class provides access to all the operations defined in DiskRestorePointsClient. */ +public interface DiskRestorePointsClient { + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskRestorePointInner get( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName); + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java new file mode 100644 index 0000000000000..49ce8a77530c9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.azure.resourcemanager.compute.generated.models.DiskUpdate; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; + +/** An instance of this class provides access to all the operations defined in DisksClient. */ +public interface DisksClient { + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk); + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk, Context context); + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk); + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context); + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk); + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk, Context context); + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk); + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context); + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskInner getByResourceGroup(String resourceGroupName, String diskName); + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String diskName); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskName); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskName, Context context); + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName, Context context); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String diskName); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String diskName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java new file mode 100644 index 0000000000000..03b4509b0cc8f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.GalleryInner; +import com.azure.resourcemanager.compute.generated.models.GalleryUpdate; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; + +/** An instance of this class provides access to all the operations defined in GalleriesClient. */ +public interface GalleriesClient { + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery); + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context); + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery); + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery, Context context); + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery); + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context); + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery); + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context); + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryInner getByResourceGroup(String resourceGroupName, String galleryName); + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryName, SelectPermissions select, Context context); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, Context context); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, Context context); + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List galleries under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List galleries under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java new file mode 100644 index 0000000000000..c90b25da512ff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** An instance of this class provides access to all the operations defined in GalleryApplicationVersionsClient. */ +public interface GalleryApplicationVersionsClient { + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion); + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context); + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion); + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context); + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion); + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context); + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationVersionInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion); + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationVersionInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context); + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationVersionInner get( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName); + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context); + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName); + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java new file mode 100644 index 0000000000000..1349679a71f40 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.GalleryApplicationInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationUpdate; + +/** An instance of this class provides access to all the operations defined in GalleryApplicationsClient. */ +public interface GalleryApplicationsClient { + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication); + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context); + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication); + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context); + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication); + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context); + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication); + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context); + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName); + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryApplicationName); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryApplicationName, Context context); + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName); + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java new file mode 100644 index 0000000000000..7602f510df265 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.GalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; + +/** An instance of this class provides access to all the operations defined in GalleryImageVersionsClient. */ +public interface GalleryImageVersionsClient { + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion); + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context); + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion); + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context); + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion); + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context); + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageVersionInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion); + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageVersionInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context); + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageVersionInner get( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName, String galleryImageVersionName); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context); + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName); + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java new file mode 100644 index 0000000000000..f2dcb6fd94272 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImagesClient.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.GalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.GalleryImageUpdate; + +/** An instance of this class provides access to all the operations defined in GalleryImagesClient. */ +public interface GalleryImagesClient { + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context); + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner createOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage); + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context); + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context); + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner update( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage); + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context); + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName); + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, Context context); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, Context context); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName, Context context); + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName); + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GallerySharingProfilesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GallerySharingProfilesClient.java new file mode 100644 index 0000000000000..46f4214a7b70a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GallerySharingProfilesClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; + +/** An instance of this class provides access to all the operations defined in GallerySharingProfilesClient. */ +public interface GallerySharingProfilesClient { + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate); + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context); + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharingUpdateInner update(String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate); + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharingUpdateInner update( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java new file mode 100644 index 0000000000000..f1493a768d227 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ImagesClient.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.ImageInner; +import com.azure.resourcemanager.compute.generated.models.ImageUpdate; + +/** An instance of this class provides access to all the operations defined in ImagesClient. */ +public interface ImagesClient { + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters); + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context); + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters); + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters, Context context); + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters); + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context); + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters); + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters, Context context); + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String imageName); + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String imageName, Context context); + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 imageName); + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 imageName, Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner getByResourceGroup(String resourceGroupName, String imageName); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, Context context); + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java new file mode 100644 index 0000000000000..3db0c1fc69b45 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/LogAnalyticsClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; +import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput; +import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput; + +/** An instance of this class provides access to all the operations defined in LogAnalyticsClient. */ +public interface LogAnalyticsClient { + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters); + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context); + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters); + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters, Context context); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogAnalyticsOperationResultInner exportThrottledRequests(String location, ThrottledRequestsInput parameters); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogAnalyticsOperationResultInner exportThrottledRequests( + String location, ThrottledRequestsInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..62358bd360600 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of compute operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.java new file mode 100644 index 0000000000000..c74fa37472510 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ProximityPlacementGroupsClient.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupUpdate; + +/** An instance of this class provides access to all the operations defined in ProximityPlacementGroupsClient. */ +public interface ProximityPlacementGroupsClient { + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProximityPlacementGroupInner createOrUpdate( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters); + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context); + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProximityPlacementGroupInner update( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters); + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupUpdate parameters, + Context context); + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String proximityPlacementGroupName); + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String proximityPlacementGroupName, Context context); + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProximityPlacementGroupInner getByResourceGroup(String resourceGroupName, String proximityPlacementGroupName); + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context); + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.java new file mode 100644 index 0000000000000..55102db44409a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ResourceSkusClient.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; + +/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ +public interface ResourceSkusClient { + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java new file mode 100644 index 0000000000000..764f2e5ac2864 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointCollectionsClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; + +/** An instance of this class provides access to all the operations defined in RestorePointCollectionsClient. */ +public interface RestorePointCollectionsClient { + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner createOrUpdate( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters); + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context); + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner update( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters); + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, Context context); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointCollectionInner getByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of restore point collections 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java new file mode 100644 index 0000000000000..56ffffef67d62 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/RestorePointsClient.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.compute.generated.fluent.models.RestorePointInner; + +/** An instance of this class provides access to all the operations defined in RestorePointsClient. */ +public interface RestorePointsClient { + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters); + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner get(String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleriesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleriesClient.java new file mode 100644 index 0000000000000..3f8ae0a14f9e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleriesClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; + +/** An instance of this class provides access to all the operations defined in SharedGalleriesClient. */ +public interface SharedGalleriesClient { + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryInner get(String location, String galleryUniqueName); + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String galleryUniqueName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.java new file mode 100644 index 0000000000000..fb3a9677f07a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImageVersionsClient.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; + +/** An instance of this class provides access to all the operations defined in SharedGalleryImageVersionsClient. */ +public interface SharedGalleryImageVersionsClient { + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String location, String galleryUniqueName, String galleryImageName); + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryImageVersionInner get( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName); + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImagesClient.java new file mode 100644 index 0000000000000..3e692f34d7fee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SharedGalleryImagesClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.SharedGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; + +/** An instance of this class provides access to all the operations defined in SharedGalleryImagesClient. */ +public interface SharedGalleryImagesClient { + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String galleryUniqueName); + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryImageInner get(String location, String galleryUniqueName, String galleryImageName); + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java new file mode 100644 index 0000000000000..180d0864c971e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SnapshotsClient.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.SnapshotUpdate; + +/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ +public interface SnapshotsClient { + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner createOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context); + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context); + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot); + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context); + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName); + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String snapshotName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 snapshotName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 snapshotName, Context context); + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessUriInner grantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String snapshotName); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, String snapshotName, Context context); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String snapshotName); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String snapshotName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java new file mode 100644 index 0000000000000..2304c104dfd9e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/SshPublicKeysClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyUpdateResource; + +/** An instance of this class provides access to all the operations defined in SshPublicKeysClient. */ +public interface SshPublicKeysClient { + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SshPublicKeyResourceInner create( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters); + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context); + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SshPublicKeyResourceInner update( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters); + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context); + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 sshPublicKeyName); + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context); + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SshPublicKeyResourceInner getByResourceGroup(String resourceGroupName, String sshPublicKeyName); + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SshPublicKeyGenerateKeyPairResultInner generateKeyPair(String resourceGroupName, String sshPublicKeyName); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateKeyPairWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.java new file mode 100644 index 0000000000000..6a1b8989b5c59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/UsagesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.java new file mode 100644 index 0000000000000..ad0ac0cc39091 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionImagesClient.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionImagesClient. */ +public interface VirtualMachineExtensionImagesClient { + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionImageInner get(String location, String publisherName, String type, String version); + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisherName, String type, String version, Context context); + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listTypes(String location, String publisherName); + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listTypesWithResponse( + String location, String publisherName, Context context); + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listVersions(String location, String publisherName, String type); + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java new file mode 100644 index 0000000000000..f408354560fbd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineExtensionsClient.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionUpdate; + +/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionsClient. */ +public interface VirtualMachineExtensionsClient { + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters); + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context); + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionInner createOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters); + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionInner createOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context); + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters); + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionInner update( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters); + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionInner update( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, String vmExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName, Context context); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, String vmExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, String vmExtensionName, Context context); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context); + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmName); + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String vmName, String expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java new file mode 100644 index 0000000000000..b602ce62b4504 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesClient.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in VirtualMachineImagesClient. */ +public interface VirtualMachineImagesClient { + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineImageInner get(String location, String publisherName, String offer, String skus, String version); + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, Context context); + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List list(String location, String publisherName, String offer, String skus); + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listWithResponse( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context); + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listOffers(String location, String publisherName); + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listOffersWithResponse( + String location, String publisherName, Context context); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listPublishers(String location); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listPublishersWithResponse(String location, Context context); + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listSkus(String location, String publisherName, String offer); + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listSkusWithResponse( + String location, String publisherName, String offer, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.java new file mode 100644 index 0000000000000..0c5d3b45d78b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineImagesEdgeZonesClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in VirtualMachineImagesEdgeZonesClient. */ +public interface VirtualMachineImagesEdgeZonesClient { + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineImageInner get( + String location, String edgeZone, String publisherName, String offer, String skus, String version); + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + Context context); + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List list( + String location, String edgeZone, String publisherName, String offer, String skus); + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context); + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listOffers(String location, String edgeZone, String publisherName); + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, Context context); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listPublishers(String location, String edgeZone); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listPublishersWithResponse( + String location, String edgeZone, Context context); + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listSkus( + String location, String edgeZone, String publisherName, String offer); + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineRunCommandsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineRunCommandsClient.java new file mode 100644 index 0000000000000..4a837259ef8e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineRunCommandsClient.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; + +/** An instance of this class provides access to all the operations defined in VirtualMachineRunCommandsClient. */ +public interface VirtualMachineRunCommandsClient { + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command 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 specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandDocumentInner get(String location, String commandId); + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command 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 specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String commandId, Context context); + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context); + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand); + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner update( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand); + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, String runCommandName); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String runCommandName, Context context); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmName, String runCommandName); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmName, String runCommandName, Context context); + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner getByVirtualMachine(String resourceGroupName, String vmName, String runCommandName); + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, Context context); + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachine(String resourceGroupName, String vmName); + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachine( + String resourceGroupName, String vmName, String expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java new file mode 100644 index 0000000000000..3ad6580babb7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetExtensionsClient.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionUpdate; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetExtensionsClient. + */ +public interface VirtualMachineScaleSetExtensionsClient { + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters); + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context); + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters); + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context); + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetExtensionInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters); + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetExtensionInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters); + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String vmssExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String vmssExtensionName, Context context); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetExtensionInner get(String resourceGroupName, String vmScaleSetName, String vmssExtensionName); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context); + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vmScaleSetName); + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vmScaleSetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.java new file mode 100644 index 0000000000000..230adef3f6e90 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetRollingUpgradesClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; + +/** + * An instance of this class provides access to all the operations defined in + * VirtualMachineScaleSetRollingUpgradesClient. + */ +public interface VirtualMachineScaleSetRollingUpgradesClient { + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName); + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String vmScaleSetName); + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStartOSUpgrade( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startOSUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStartExtensionUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName); + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLatestWithResponse( + String resourceGroupName, String vmScaleSetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMExtensionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMExtensionsClient.java new file mode 100644 index 0000000000000..38f26fa4bc62f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMExtensionsClient.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionUpdate; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMExtensionsClient. + */ +public interface VirtualMachineScaleSetVMExtensionsClient { + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters); + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context); + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters); + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context); + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMExtensionInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters); + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMExtensionInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters); + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context); + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context); + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName); + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName, Context context); + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + Context context); + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMExtensionsListResultInner list( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMRunCommandsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMRunCommandsClient.java new file mode 100644 index 0000000000000..0dd9c4c23217a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMRunCommandsClient.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMRunCommandsClient. + */ +public interface VirtualMachineScaleSetVMRunCommandsClient { + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand); + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context); + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand); + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName, Context context); + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineRunCommandInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + Context context); + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java new file mode 100644 index 0000000000000..102acb64bdc25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java @@ -0,0 +1,954 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters; + +/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetVMsClient. */ +public interface VirtualMachineScaleSetVMsClient { + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMInner update( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String instanceId, Boolean forceDeletion); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String instanceId, Boolean forceDeletion, Context context); + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context); + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetVMInstanceViewInner getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + Context context); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java new file mode 100644 index 0000000000000..0ff2858788074 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java @@ -0,0 +1,1388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; + +/** An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. */ +public interface VirtualMachineScaleSetsClient { + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context); + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters); + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context); + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context); + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters); + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, Boolean forceDeletion); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmScaleSetName); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, Boolean forceDeletion, Context context); + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName); + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmScaleSetName); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context); + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName); + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus(String resourceGroupName, String vmScaleSetName); + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName); + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String vmScaleSetName); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmScaleSetName); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmScaleSetName); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmScaleSetName); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance(String resourceGroupName, String vmScaleSetName); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 performMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void updateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String vmScaleSetName); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimageAll(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimageAll(String resourceGroupName, String vmScaleSetName); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain); + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.java new file mode 100644 index 0000000000000..4122c59020def --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; + +/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ +public interface VirtualMachineSizesClient { + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java new file mode 100644 index 0000000000000..002441ad4c092 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public interface VirtualMachinesClient { + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineCaptureResultInner capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineCaptureResultInner capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context); + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters); + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context); + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters); + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner createOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context); + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context); + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters); + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner update( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String vmName, Boolean forceDeletion); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, Boolean forceDeletion, Context context); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, Boolean forceDeletion); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmName); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, Boolean forceDeletion, Context context); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context); + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName); + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response instanceViewWithResponse( + String resourceGroupName, String vmName, Context context); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginConvertToManagedDisks( + String resourceGroupName, String vmName, Context context); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void convertToManagedDisks(String resourceGroupName, String vmName); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void convertToManagedDisks(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deallocate(String resourceGroupName, String vmName, Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void generalize(String resourceGroupName, String vmName); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generalizeWithResponse(String resourceGroupName, String vmName, Context context); + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String statusOnly, Context context); + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes(String resourceGroupName, String vmName); + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSizes(String resourceGroupName, String vmName, Context context); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff(String resourceGroupName, String vmName, Boolean skipShutdown); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void powerOff(String resourceGroupName, String vmName); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReapply(String resourceGroupName, String vmName); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReapply(String resourceGroupName, String vmName, Context context); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reapply(String resourceGroupName, String vmName); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 reapply(String resourceGroupName, String vmName, Context context); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart(String resourceGroupName, String vmName); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart(String resourceGroupName, String vmName, Context context); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmName); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String vmName, Context context); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String vmName); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String vmName, Context context); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmName); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void redeploy(String resourceGroupName, String vmName, Context context); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String vmName); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData(String resourceGroupName, String vmName); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmName); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmName, Context context); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance(String resourceGroupName, String vmName); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void performMaintenance(String resourceGroupName, String vmName, Context context); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void simulateEviction(String resourceGroupName, String vmName); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName, Context context); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName, Context context); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstallPatchesResultInner installPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstallPatchesResultInner installPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.java new file mode 100644 index 0000000000000..0210a84701bcf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AccessUriInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A disk access SAS uri. */ +@Immutable +public final class AccessUriInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessUriInner.class); + + /* + * A SAS uri for accessing a disk. + */ + @JsonProperty(value = "accessSAS", access = JsonProperty.Access.WRITE_ONLY) + private String accessSas; + + /** + * Get the accessSas property: A SAS uri for accessing a disk. + * + * @return the accessSas value. + */ + public String accessSas() { + return this.accessSas; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java new file mode 100644 index 0000000000000..628d891e3aa1f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines + * specified in the same availability set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For more + * information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, a + * VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + */ +@JsonFlatten +@Fluent +public class AvailabilitySetInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetInner.class); + + /* + * Sku of the availability set, only name is required to be set. See + * AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for + * virtual machines with managed disks and 'Classic' for virtual machines + * with unmanaged disks. Default value is 'Classic'. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Update Domain count. + */ + @JsonProperty(value = "properties.platformUpdateDomainCount") + private Integer platformUpdateDomainCount; + + /* + * Fault Domain count. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * A list of references to all virtual machines in the availability set. + */ + @JsonProperty(value = "properties.virtualMachines") + private List virtualMachines; + + /* + * Specifies information about the proximity placement group that the + * availability set should be assigned to.

Minimum api-version: + * 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * The resource status information. + */ + @JsonProperty(value = "properties.statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** + * Get the sku property: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes + * for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual + * machines with unmanaged disks. Default value is 'Classic'. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes + * for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual + * machines with unmanaged disks. Default value is 'Classic'. + * + * @param sku the sku value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the platformUpdateDomainCount property: Update Domain count. + * + * @return the platformUpdateDomainCount value. + */ + public Integer platformUpdateDomainCount() { + return this.platformUpdateDomainCount; + } + + /** + * Set the platformUpdateDomainCount property: Update Domain count. + * + * @param platformUpdateDomainCount the platformUpdateDomainCount value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { + this.platformUpdateDomainCount = platformUpdateDomainCount; + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Fault Domain count. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get the virtualMachines property: A list of references to all virtual machines in the availability set. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: A list of references to all virtual machines in the availability set. + * + * @param virtualMachines the virtualMachines value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the AvailabilitySetInner object itself. + */ + public AvailabilitySetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java new file mode 100644 index 0000000000000..6f2baabe23723 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationGroupInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the capacity reservation group that the capacity reservations should be assigned to. + * <br><br> Currently, a capacity reservation can only be added to a capacity reservation group at creation + * time. An existing capacity reservation cannot be added or moved to another capacity reservation group. + */ +@JsonFlatten +@Fluent +public class CapacityReservationGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationGroupInner.class); + + /* + * Availability Zones to use for this capacity reservation group. The zones + * can be assigned only during creation. If not provided, the group + * supports only regional resources in the region. If provided, enforces + * each capacity reservation in the group to be in one of the zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A list of all capacity reservation resource ids that belong to capacity + * reservation group. + */ + @JsonProperty(value = "properties.capacityReservations", access = JsonProperty.Access.WRITE_ONLY) + private List capacityReservations; + + /* + * A list of references to all virtual machines associated to the capacity + * reservation group. + */ + @JsonProperty(value = "properties.virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The capacity reservation group instance view which has the list of + * instance views for all the capacity reservations that belong to the + * capacity reservation group. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationGroupInstanceView instanceView; + + /** + * Get the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @param zones the zones value to set. + * @return the CapacityReservationGroupInner object itself. + */ + public CapacityReservationGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.capacityReservations; + } + + /** + * Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + public CapacityReservationGroupInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityReservations() != null) { + capacityReservations().forEach(e -> e.validate()); + } + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java new file mode 100644 index 0000000000000..e50c47e1f1ea5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CapacityReservationInner.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceView; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation. */ +@JsonFlatten +@Fluent +public class CapacityReservationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationInner.class); + + /* + * SKU of the resource for which capacity needs be reserved. The SKU name + * and capacity is required to be set. Currently VM Skus with the + * capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + * supported values. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Availability Zone to use for this capacity reservation. The zone has to + * be single value and also should be part for the list of zones specified + * during the capacity reservation group creation. The zone can be assigned + * only during creation. If not provided, the reservation supports only + * non-zonal deployments. If provided, enforces VM/VMSS using this capacity + * reservation to be in same zone. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * A unique id generated and assigned to the capacity reservation by the + * platform which does not change throughout the lifetime of the resource. + */ + @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * A list of all virtual machine resource ids that are associated with the + * capacity reservation. + */ + @JsonProperty(value = "properties.virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The date time when the capacity reservation was last updated. + */ + @JsonProperty(value = "properties.provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Capacity reservation instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationInstanceView instanceView; + + /** + * Get the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @param sku the sku value to set. + * @return the CapacityReservationInner object itself. + */ + public CapacityReservationInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @param zones the zones value to set. + * @return the CapacityReservationInner object itself. + */ + public CapacityReservationInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.provisioningTime; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + public CapacityReservationInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model CapacityReservationInner")); + } else { + sku().validate(); + } + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.java new file mode 100644 index 0000000000000..adf7292ad30ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the cloud service. */ +@Fluent +public final class CloudServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceInner.class); + + /* + * Cloud service properties + */ + @JsonProperty(value = "properties") + private CloudServiceProperties properties; + + /** + * Get the properties property: Cloud service properties. + * + * @return the properties value. + */ + public CloudServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Cloud service properties. + * + * @param properties the properties value to set. + * @return the CloudServiceInner object itself. + */ + public CloudServiceInner withProperties(CloudServiceProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public CloudServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CloudServiceInner withTags(Map tags) { + super.withTags(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java new file mode 100644 index 0000000000000..9c82cbef94eb5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceInstanceViewInner.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** InstanceView of CloudService as a whole. */ +@Fluent +public final class CloudServiceInstanceViewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceInstanceViewInner.class); + + /* + * Instance view statuses. + */ + @JsonProperty(value = "roleInstance") + private InstanceViewStatusesSummary roleInstance; + + /* + * The version of the SDK that was used to generate the package for the + * cloud service. + */ + @JsonProperty(value = "sdkVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sdkVersion; + + /* + * Specifies a list of unique identifiers generated internally for the + * cloud service.

NOTE: If you are using Azure Diagnostics + * extension, this property can be used as 'DeploymentId' for querying + * details. + */ + @JsonProperty(value = "privateIds", access = JsonProperty.Access.WRITE_ONLY) + private List privateIds; + + /* + * The statuses property. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** + * Get the roleInstance property: Instance view statuses. + * + * @return the roleInstance value. + */ + public InstanceViewStatusesSummary roleInstance() { + return this.roleInstance; + } + + /** + * Set the roleInstance property: Instance view statuses. + * + * @param roleInstance the roleInstance value to set. + * @return the CloudServiceInstanceViewInner object itself. + */ + public CloudServiceInstanceViewInner withRoleInstance(InstanceViewStatusesSummary roleInstance) { + this.roleInstance = roleInstance; + return this; + } + + /** + * Get the sdkVersion property: The version of the SDK that was used to generate the package for the cloud service. + * + * @return the sdkVersion value. + */ + public String sdkVersion() { + return this.sdkVersion; + } + + /** + * Get the privateIds property: Specifies a list of unique identifiers generated internally for the cloud service. + * <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as + * 'DeploymentId' for querying details. + * + * @return the privateIds value. + */ + public List privateIds() { + return this.privateIds; + } + + /** + * Get the statuses property: The statuses property. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleInstance() != null) { + roleInstance().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java new file mode 100644 index 0000000000000..cb17fddcaa60d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/CloudServiceRoleInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a role of the cloud service. */ +@Fluent +public final class CloudServiceRoleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleInner.class); + + /* + * Resource id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Describes the cloud service role sku. + */ + @JsonProperty(value = "sku") + private CloudServiceRoleSku sku; + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private CloudServiceRoleProperties properties; + + /** + * Get the id property: Resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the sku property: Describes the cloud service role sku. + * + * @return the sku value. + */ + public CloudServiceRoleSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the cloud service role sku. + * + * @param sku the sku value to set. + * @return the CloudServiceRoleInner object itself. + */ + public CloudServiceRoleInner withSku(CloudServiceRoleSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public CloudServiceRoleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the CloudServiceRoleInner object itself. + */ + public CloudServiceRoleInner withProperties(CloudServiceRoleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueInner.java new file mode 100644 index 0000000000000..7584ab9d727fa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ComputeOperationValueInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Compute Operation value. */ +@JsonFlatten +@Immutable +public class ComputeOperationValueInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeOperationValueInner.class); + + /* + * The origin of the compute operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The name of the compute operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The display name of the compute operation. + */ + @JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The description of the operation. + */ + @JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The resource provider for the operation. + */ + @JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the origin property: The origin of the compute operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the name property: The name of the compute operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupInner.java new file mode 100644 index 0000000000000..9400785fbb63d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostGroupInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the dedicated host group that the dedicated hosts should be assigned to. + * <br><br> Currently, a dedicated host can only be added to a dedicated host group at creation time. An + * existing dedicated host cannot be added to another dedicated host group. + */ +@JsonFlatten +@Fluent +public class DedicatedHostGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupInner.class); + + /* + * Availability Zone to use for this host group. Only single zone is + * supported. The zone can be assigned only during creation. If not + * provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Number of fault domains that the host group can span. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * A list of references to all dedicated hosts in the dedicated host group. + */ + @JsonProperty(value = "properties.hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /* + * The dedicated host group instance view, which has the list of instance + * view of the dedicated hosts under the dedicated host group. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private DedicatedHostGroupInstanceView instanceView; + + /* + * Specifies whether virtual machines or virtual machine scale sets can be + * placed automatically on the dedicated host group. Automatic placement + * means resources are allocated on dedicated hosts, that are chosen by + * Azure, under the dedicated host group. The value is defaulted to 'false' + * when not provided.

Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "properties.supportAutomaticPlacement") + private Boolean supportAutomaticPlacement; + + /** + * Get the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can + * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can + * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + * + * @param zones the zones value to set. + * @return the DedicatedHostGroupInner object itself. + */ + public DedicatedHostGroupInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the DedicatedHostGroupInner object itself. + */ + public DedicatedHostGroupInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get the hosts property: A list of references to all dedicated hosts in the dedicated host group. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Get the instanceView property: The dedicated host group instance view, which has the list of instance view of the + * dedicated hosts under the dedicated host group. + * + * @return the instanceView value. + */ + public DedicatedHostGroupInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can + * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on + * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when + * not provided. <br><br>Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + public Boolean supportAutomaticPlacement() { + return this.supportAutomaticPlacement; + } + + /** + * Set the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can + * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on + * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when + * not provided. <br><br>Minimum api-version: 2020-06-01. + * + * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. + * @return the DedicatedHostGroupInner object itself. + */ + public DedicatedHostGroupInner withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + this.supportAutomaticPlacement = supportAutomaticPlacement; + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hosts() != null) { + hosts().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostInner.java new file mode 100644 index 0000000000000..128adb571f49d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DedicatedHostInner.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the Dedicated host. */ +@JsonFlatten +@Fluent +public class DedicatedHostInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInner.class); + + /* + * SKU of the dedicated host for Hardware Generation and VM family. Only + * name is required to be set. List Microsoft.Compute SKUs for a list of + * possible values. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Fault domain of the dedicated host within a dedicated host group. + */ + @JsonProperty(value = "properties.platformFaultDomain") + private Integer platformFaultDomain; + + /* + * Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + */ + @JsonProperty(value = "properties.autoReplaceOnFailure") + private Boolean autoReplaceOnFailure; + + /* + * A unique id generated and assigned to the dedicated host by the + * platform.

Does not change throughout the lifetime of the host. + */ + @JsonProperty(value = "properties.hostId", access = JsonProperty.Access.WRITE_ONLY) + private String hostId; + + /* + * A list of references to all virtual machines in the Dedicated Host. + */ + @JsonProperty(value = "properties.virtualMachines", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachines; + + /* + * Specifies the software license type that will be applied to the VMs + * deployed on the dedicated host.

Possible values are:

+ * **None**

**Windows_Server_Hybrid**

+ * **Windows_Server_Perpetual**

Default: **None** + */ + @JsonProperty(value = "properties.licenseType") + private DedicatedHostLicenseTypes licenseType; + + /* + * The date when the host was first provisioned. + */ + @JsonProperty(value = "properties.provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The dedicated host instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private DedicatedHostInstanceView instanceView; + + /** + * Get the sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is required to + * be set. List Microsoft.Compute SKUs for a list of possible values. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is required to + * be set. List Microsoft.Compute SKUs for a list of possible values. + * + * @param sku the sku value to set. + * @return the DedicatedHostInner object itself. + */ + public DedicatedHostInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the DedicatedHostInner object itself. + */ + public DedicatedHostInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + * + * @return the autoReplaceOnFailure value. + */ + public Boolean autoReplaceOnFailure() { + return this.autoReplaceOnFailure; + } + + /** + * Set the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + * + * @param autoReplaceOnFailure the autoReplaceOnFailure value to set. + * @return the DedicatedHostInner object itself. + */ + public DedicatedHostInner withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { + this.autoReplaceOnFailure = autoReplaceOnFailure; + return this; + } + + /** + * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. + * <br><br> Does not change throughout the lifetime of the host. + * + * @return the hostId value. + */ + public String hostId() { + return this.hostId; + } + + /** + * Get the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Get the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> + * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: + * **None**. + * + * @return the licenseType value. + */ + public DedicatedHostLicenseTypes licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> + * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: + * **None**. + * + * @param licenseType the licenseType value to set. + * @return the DedicatedHostInner object itself. + */ + public DedicatedHostInner withLicenseType(DedicatedHostLicenseTypes licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the provisioningTime property: The date when the host was first provisioned. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.provisioningTime; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The dedicated host instance view. + * + * @return the instanceView value. + */ + public DedicatedHostInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model DedicatedHostInner")); + } else { + sku().validate(); + } + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessInner.java new file mode 100644 index 0000000000000..ae7a719245ecf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskAccessInner.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** disk access resource. */ +@JsonFlatten +@Fluent +public class DiskAccessInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskAccessInner.class); + + /* + * A readonly collection of private endpoint connections created on the + * disk. Currently only one endpoint connection is supported. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The disk access resource provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The time when the disk access was created. + */ + @JsonProperty(value = "properties.timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** + * Get the privateEndpointConnections property: A readonly collection of private endpoint connections created on the + * disk. Currently only one endpoint connection is supported. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the provisioningState property: The disk access resource provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the timeCreated property: The time when the disk access was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** {@inheritDoc} */ + @Override + public DiskAccessInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskAccessInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.java new file mode 100644 index 0000000000000..d5d3ef780a2b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType; +import com.azure.resourcemanager.compute.generated.models.EncryptionSetIdentity; +import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** disk encryption set resource. */ +@JsonFlatten +@Fluent +public class DiskEncryptionSetInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetInner.class); + + /* + * The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks. + */ + @JsonProperty(value = "identity") + private EncryptionSetIdentity identity; + + /* + * The type of key used to encrypt the data of the disk. + */ + @JsonProperty(value = "properties.encryptionType") + private DiskEncryptionSetType encryptionType; + + /* + * The key vault key which is currently used by this disk encryption set. + */ + @JsonProperty(value = "properties.activeKey") + private KeyForDiskEncryptionSet activeKey; + + /* + * A readonly collection of key vault keys previously used by this disk + * encryption set while a key rotation is in progress. It will be empty if + * there is no ongoing key rotation. + */ + @JsonProperty(value = "properties.previousKeys", access = JsonProperty.Access.WRITE_ONLY) + private List previousKeys; + + /* + * The disk encryption set provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Set this flag to true to enable auto-updating of this disk encryption + * set to the latest key version. + */ + @JsonProperty(value = "properties.rotationToLatestKeyVersionEnabled") + private Boolean rotationToLatestKeyVersionEnabled; + + /* + * The time when the active key of this disk encryption set was updated. + */ + @JsonProperty(value = "properties.lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * Get the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @return the identity value. + */ + public EncryptionSetIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @param identity the identity value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withIdentity(EncryptionSetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @return the encryptionType value. + */ + public DiskEncryptionSetType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @param encryptionType the encryptionType value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withEncryptionType(DiskEncryptionSetType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the activeKey property: The key vault key which is currently used by this disk encryption set. + * + * @return the activeKey value. + */ + public KeyForDiskEncryptionSet activeKey() { + return this.activeKey; + } + + /** + * Set the activeKey property: The key vault key which is currently used by this disk encryption set. + * + * @param activeKey the activeKey value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withActiveKey(KeyForDiskEncryptionSet activeKey) { + this.activeKey = activeKey; + return this; + } + + /** + * Get the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption + * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + * + * @return the previousKeys value. + */ + public List previousKeys() { + return this.previousKeys; + } + + /** + * Get the provisioningState property: The disk encryption set provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.rotationToLatestKeyVersionEnabled; + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the DiskEncryptionSetInner object itself. + */ + public DiskEncryptionSetInner withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + this.rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + return this; + } + + /** + * Get the lastKeyRotationTimestamp property: The time when the active key of this disk encryption set was updated. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** {@inheritDoc} */ + @Override + public DiskEncryptionSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskEncryptionSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (activeKey() != null) { + activeKey().validate(); + } + if (previousKeys() != null) { + previousKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.java new file mode 100644 index 0000000000000..38549a6acf85d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.java @@ -0,0 +1,830 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.ShareInfoElement; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Disk resource. */ +@JsonFlatten +@Fluent +public class DiskInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInner.class); + + /* + * A relative URI containing the ID of the VM that has the disk attached. + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; + + /* + * List of relative URIs containing the IDs of the VMs that have the disk + * attached. maxShares should be set to a value greater than one for disks + * to allow attaching them to multiple VMs. + */ + @JsonProperty(value = "managedByExtended", access = JsonProperty.Access.WRITE_ONLY) + private List managedByExtended; + + /* + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, or StandardSSD_ZRS. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /* + * The Logical zone list for Disk. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The extended location where the disk will be created. Extended location + * cannot be changed. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The time when the disk was created. + */ + @JsonProperty(value = "properties.timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * The Operating System type. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * Purchase plan information for the the image from which the OS disk was + * created. E.g. - {name: 2019-Datacenter, publisher: + * MicrosoftWindowsServer, product: WindowsServer} + */ + @JsonProperty(value = "properties.purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * Disk source information. CreationData information cannot be changed + * after the disk has been created. + */ + @JsonProperty(value = "properties.creationData") + private CreationData creationData; + + /* + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /* + * The size of the disk in bytes. This field is read only. + */ + @JsonProperty(value = "properties.diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long diskSizeBytes; + + /* + * Unique Guid identifying the resource. + */ + @JsonProperty(value = "properties.uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /* + * Encryption settings collection used for Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * The disk provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The number of IOPS allowed for this disk; only settable for UltraSSD + * disks. One operation can transfer between 4k and 256k bytes. + */ + @JsonProperty(value = "properties.diskIOPSReadWrite") + private Long diskIopsReadWrite; + + /* + * The bandwidth allowed for this disk; only settable for UltraSSD disks. + * MBps means millions of bytes per second - MB here uses the ISO notation, + * of powers of 10. + */ + @JsonProperty(value = "properties.diskMBpsReadWrite") + private Long diskMBpsReadWrite; + + /* + * The total number of IOPS that will be allowed across all VMs mounting + * the shared disk as ReadOnly. One operation can transfer between 4k and + * 256k bytes. + */ + @JsonProperty(value = "properties.diskIOPSReadOnly") + private Long diskIopsReadOnly; + + /* + * The total throughput (MBps) that will be allowed across all VMs mounting + * the shared disk as ReadOnly. MBps means millions of bytes per second - + * MB here uses the ISO notation, of powers of 10. + */ + @JsonProperty(value = "properties.diskMBpsReadOnly") + private Long diskMBpsReadOnly; + + /* + * The state of the disk. + */ + @JsonProperty(value = "properties.diskState", access = JsonProperty.Access.WRITE_ONLY) + private DiskState diskState; + + /* + * Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * The maximum number of VMs that can attach to the disk at the same time. + * Value greater than one indicates a disk that can be mounted on multiple + * VMs at the same time. + */ + @JsonProperty(value = "properties.maxShares") + private Integer maxShares; + + /* + * Details of the list of all VMs that have the disk attached. maxShares + * should be set to a value greater than one for disks to allow attaching + * them to multiple VMs. + */ + @JsonProperty(value = "properties.shareInfo", access = JsonProperty.Access.WRITE_ONLY) + private List shareInfo; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "properties.networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "properties.diskAccessId") + private String diskAccessId; + + /* + * Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does + * not apply to Ultra disks. + */ + @JsonProperty(value = "properties.tier") + private String tier; + + /* + * Set to true to enable bursting beyond the provisioned performance target + * of the disk. Bursting is disabled by default. Does not apply to Ultra + * disks. + */ + @JsonProperty(value = "properties.burstingEnabled") + private Boolean burstingEnabled; + + /* + * Properties of the disk for which update is pending. + */ + @JsonProperty(value = "properties.propertyUpdatesInProgress", access = JsonProperty.Access.WRITE_ONLY) + private PropertyUpdatesInProgress propertyUpdatesInProgress; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "properties.supportsHibernation") + private Boolean supportsHibernation; + + /* + * Contains the security related information for the resource. + */ + @JsonProperty(value = "properties.securityProfile") + private DiskSecurityProfile securityProfile; + + /** + * Get the managedBy property: A relative URI containing the ID of the VM that has the disk attached. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Get the managedByExtended property: List of relative URIs containing the IDs of the VMs that have the disk + * attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the managedByExtended value. + */ + public List managedByExtended() { + return this.managedByExtended; + } + + /** + * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * + * @return the sku value. + */ + public DiskSku sku() { + return this.sku; + } + + /** + * Set the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * + * @param sku the sku value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSku(DiskSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: The Logical zone list for Disk. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The Logical zone list for Disk. + * + * @param zones the zones value to set. + * @return the DiskInner object itself. + */ + public DiskInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the extendedLocation property: The extended location where the disk will be created. Extended location cannot + * be changed. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location where the disk will be created. Extended location cannot + * be changed. + * + * @param extendedLocation the extendedLocation value to set. + * @return the DiskInner object itself. + */ + public DiskInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the timeCreated property: The time when the disk was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The Operating System type. + * + * @param osType the osType value to set. + * @return the DiskInner object itself. + */ + public DiskInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the DiskInner object itself. + */ + public DiskInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}. + * + * @return the purchasePlan value. + */ + public PurchasePlanAutoGenerated purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}. + * + * @param purchasePlan the purchasePlan value to set. + * @return the DiskInner object itself. + */ + public DiskInner withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk + * has been created. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk + * has been created. + * + * @param creationData the creationData value to set. + * @return the DiskInner object itself. + */ + public DiskInner withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. + * + * @return the diskSizeBytes value. + */ + public Long diskSizeBytes() { + return this.diskSizeBytes; + } + + /** + * Get the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Get the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.encryptionSettingsCollection; + } + + /** + * Set the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. + * @return the DiskInner object itself. + */ + public DiskInner withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + this.encryptionSettingsCollection = encryptionSettingsCollection; + return this; + } + + /** + * Get the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. + * One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. + * One operation can transfer between 4k and 256k bytes. + * + * @param diskIopsReadWrite the diskIopsReadWrite value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskIopsReadWrite(Long diskIopsReadWrite) { + this.diskIopsReadWrite = diskIopsReadWrite; + return this; + } + + /** + * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * + * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + this.diskMBpsReadWrite = diskMBpsReadWrite; + return this; + } + + /** + * Get the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs mounting the + * shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadOnly value. + */ + public Long diskIopsReadOnly() { + return this.diskIopsReadOnly; + } + + /** + * Set the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs mounting the + * shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * + * @param diskIopsReadOnly the diskIopsReadOnly value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskIopsReadOnly(Long diskIopsReadOnly) { + this.diskIopsReadOnly = diskIopsReadOnly; + return this; + } + + /** + * Get the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + * 10. + * + * @return the diskMBpsReadOnly value. + */ + public Long diskMBpsReadOnly() { + return this.diskMBpsReadOnly; + } + + /** + * Set the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + * 10. + * + * @param diskMBpsReadOnly the diskMBpsReadOnly value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskMBpsReadOnly(Long diskMBpsReadOnly) { + this.diskMBpsReadOnly = diskMBpsReadOnly; + return this; + } + + /** + * Get the diskState property: The state of the disk. + * + * @return the diskState value. + */ + public DiskState diskState() { + return this.diskState; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @param encryption the encryption value to set. + * @return the DiskInner object itself. + */ + public DiskInner withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the maxShares property: The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * + * @return the maxShares value. + */ + public Integer maxShares() { + return this.maxShares; + } + + /** + * Set the maxShares property: The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * + * @param maxShares the maxShares value to set. + * @return the DiskInner object itself. + */ + public DiskInner withMaxShares(Integer maxShares) { + this.maxShares = maxShares; + return this; + } + + /** + * Get the shareInfo property: Details of the list of all VMs that have the disk attached. maxShares should be set + * to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the shareInfo value. + */ + public List shareInfo() { + return this.shareInfo; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.networkAccessPolicy; + } + + /** + * Set the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @param networkAccessPolicy the networkAccessPolicy value to set. + * @return the DiskInner object itself. + */ + public DiskInner withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + this.networkAccessPolicy = networkAccessPolicy; + return this; + } + + /** + * Get the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + public String diskAccessId() { + return this.diskAccessId; + } + + /** + * Set the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @param diskAccessId the diskAccessId value to set. + * @return the DiskInner object itself. + */ + public DiskInner withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @param tier the tier value to set. + * @return the DiskInner object itself. + */ + public DiskInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @return the burstingEnabled value. + */ + public Boolean burstingEnabled() { + return this.burstingEnabled; + } + + /** + * Set the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @param burstingEnabled the burstingEnabled value to set. + * @return the DiskInner object itself. + */ + public DiskInner withBurstingEnabled(Boolean burstingEnabled) { + this.burstingEnabled = burstingEnabled; + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.propertyUpdatesInProgress; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Get the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + public DiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Contains the security related information for the resource. + * + * @param securityProfile the securityProfile value to set. + * @return the DiskInner object itself. + */ + public DiskInner withSecurityProfile(DiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (creationData() != null) { + creationData().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (shareInfo() != null) { + shareInfo().forEach(e -> e.validate()); + } + if (propertyUpdatesInProgress() != null) { + propertyUpdatesInProgress().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.java new file mode 100644 index 0000000000000..3a31b63d81b57 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.ProxyOnlyResource; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of disk restore point. */ +@JsonFlatten +@Fluent +public class DiskRestorePointInner extends ProxyOnlyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskRestorePointInner.class); + + /* + * The timestamp of restorePoint creation + */ + @JsonProperty(value = "properties.timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * arm id of source disk + */ + @JsonProperty(value = "properties.sourceResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceResourceId; + + /* + * The Operating System type. + */ + @JsonProperty(value = "properties.osType", access = JsonProperty.Access.WRITE_ONLY) + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * Purchase plan information for the the image from which the OS disk was + * created. + */ + @JsonProperty(value = "properties.purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * id of the backing snapshot's MIS family + */ + @JsonProperty(value = "properties.familyId", access = JsonProperty.Access.WRITE_ONLY) + private String familyId; + + /* + * unique incarnation id of the source disk + */ + @JsonProperty(value = "properties.sourceUniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUniqueId; + + /* + * Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys. + */ + @JsonProperty(value = "properties.encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "properties.supportsHibernation") + private Boolean supportsHibernation; + + /** + * Get the timeCreated property: The timestamp of restorePoint creation. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Get the sourceResourceId property: arm id of source disk. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * + * @return the purchasePlan value. + */ + public PurchasePlanAutoGenerated purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * + * @param purchasePlan the purchasePlan value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the familyId property: id of the backing snapshot's MIS family. + * + * @return the familyId value. + */ + public String familyId() { + return this.familyId; + } + + /** + * Get the sourceUniqueId property: unique incarnation id of the source disk. + * + * @return the sourceUniqueId value. + */ + public String sourceUniqueId() { + return this.sourceUniqueId; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskRestorePointInner object itself. + */ + public DiskRestorePointInner withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationInner.java new file mode 100644 index 0000000000000..0701519e74486 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationInner.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Specifies information about the gallery Application Definition that you want to create or update. */ +@JsonFlatten +@Fluent +public class GalleryApplicationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationInner.class); + + /* + * The description of this gallery Application Definition resource. This + * property is updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The Eula agreement for the gallery Application Definition. + */ + @JsonProperty(value = "properties.eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "properties.privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "properties.releaseNoteUri") + private String releaseNoteUri; + + /* + * The end of life date of the gallery Application Definition. This + * property can be used for decommissioning purposes. This property is + * updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This property allows you to specify the supported type of the OS that + * application is built for.

Possible values are:

+ * **Windows**

**Linux** + */ + @JsonProperty(value = "properties.supportedOSType") + private OperatingSystemTypes supportedOSType; + + /** + * Get the description property: The description of this gallery Application Definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this gallery Application Definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery Application Definition. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: The Eula agreement for the gallery Application Definition. + * + * @param eula the eula value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the supportedOSType value. + */ + public OperatingSystemTypes supportedOSType() { + return this.supportedOSType; + } + + /** + * Set the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param supportedOSType the supportedOSType value to set. + * @return the GalleryApplicationInner object itself. + */ + public GalleryApplicationInner withSupportedOSType(OperatingSystemTypes supportedOSType) { + this.supportedOSType = supportedOSType; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionInner.java new file mode 100644 index 0000000000000..fdcf7ad2120bc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryApplicationVersionInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery Application Version that you want to create or update. */ +@JsonFlatten +@Fluent +public class GalleryApplicationVersionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionInner.class); + + /* + * The publishing profile of a gallery image version. + */ + @JsonProperty(value = "properties.publishingProfile") + private GalleryApplicationVersionPublishingProfile publishingProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryApplicationVersionPropertiesProvisioningState provisioningState; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "properties.replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryApplicationVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryApplicationVersionInner object itself. + */ + public GalleryApplicationVersionInner withPublishingProfile( + GalleryApplicationVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishingProfile() != null) { + publishingProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageInner.java new file mode 100644 index 0000000000000..177ca61140066 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageInner.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Disallowed; +import com.azure.resourcemanager.compute.generated.models.GalleryImageFeature; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryImagePropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.ImagePurchasePlan; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RecommendedMachineConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the gallery image definition that you want to create or update. */ +@JsonFlatten +@Fluent +public class GalleryImageInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageInner.class); + + /* + * The description of this gallery image definition resource. This property + * is updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The Eula agreement for the gallery image definition. + */ + @JsonProperty(value = "properties.eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "properties.privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "properties.releaseNoteUri") + private String releaseNoteUri; + + /* + * This property allows you to specify the type of the OS that is included + * in the disk when creating a VM from a managed image.

Possible + * values are:

**Windows**

**Linux** + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines + * created under this image are 'Generalized' or 'Specialized'. + */ + @JsonProperty(value = "properties.osState") + private OperatingSystemStateTypes osState; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * The end of life date of the gallery image definition. This property can + * be used for decommissioning purposes. This property is updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "properties.identifier") + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this + * Image Definition. These properties are updatable. + */ + @JsonProperty(value = "properties.recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "properties.disallowed") + private Disallowed disallowed; + + /* + * Describes the gallery image definition purchase plan. This is used by + * marketplace images. + */ + @JsonProperty(value = "properties.purchasePlan") + private ImagePurchasePlan purchasePlan; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImagePropertiesProvisioningState provisioningState; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "properties.features") + private List features; + + /** + * Get the description property: The description of this gallery image definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this gallery image definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery image definition. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: The Eula agreement for the gallery image definition. + * + * @param eula the eula value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @return the osState value. + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @param osState the osState value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOsState(OperatingSystemStateTypes osState) { + this.osState = osState; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @return the recommended value. + */ + public RecommendedMachineConfiguration recommended() { + return this.recommended; + } + + /** + * Set the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @param recommended the recommended value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withRecommended(RecommendedMachineConfiguration recommended) { + this.recommended = recommended; + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.disallowed; + } + + /** + * Set the disallowed property: Describes the disallowed disk types. + * + * @param disallowed the disallowed value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withDisallowed(Disallowed disallowed) { + this.disallowed = disallowed; + return this; + } + + /** + * Get the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @return the purchasePlan value. + */ + public ImagePurchasePlan purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @param purchasePlan the purchasePlan value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryImagePropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: A list of gallery image features. + * + * @param features the features value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withFeatures(List features) { + this.features = features; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identifier() != null) { + identifier().validate(); + } + if (recommended() != null) { + recommended().validate(); + } + if (disallowed() != null) { + disallowed().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionInner.java new file mode 100644 index 0000000000000..bf7e08e7e6a6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryImageVersionInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery image version that you want to create or update. */ +@JsonFlatten +@Fluent +public class GalleryImageVersionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionInner.class); + + /* + * The publishing profile of a gallery image Version. + */ + @JsonProperty(value = "properties.publishingProfile") + private GalleryImageVersionPublishingProfile publishingProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImageVersionPropertiesProvisioningState provisioningState; + + /* + * This is the storage profile of a Gallery Image Version. + */ + @JsonProperty(value = "properties.storageProfile") + private GalleryImageVersionStorageProfile storageProfile; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "properties.replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** + * Get the publishingProfile property: The publishing profile of a gallery image Version. + * + * @return the publishingProfile value. + */ + public GalleryImageVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image Version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryImageVersionInner object itself. + */ + public GalleryImageVersionInner withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryImageVersionPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @param storageProfile the storageProfile value to set. + * @return the GalleryImageVersionInner object itself. + */ + public GalleryImageVersionInner withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishingProfile() != null) { + publishingProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryInner.java new file mode 100644 index 0000000000000..2309c87ddeb2a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/GalleryInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.GalleryIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the Shared Image Gallery that you want to create or update. */ +@JsonFlatten +@Fluent +public class GalleryInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryInner.class); + + /* + * The description of this Shared Image Gallery resource. This property is + * updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Describes the gallery unique name. + */ + @JsonProperty(value = "properties.identifier") + private GalleryIdentifier identifier; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryPropertiesProvisioningState provisioningState; + + /* + * Profile for gallery sharing to subscription or tenant + */ + @JsonProperty(value = "properties.sharingProfile") + private SharingProfile sharingProfile; + + /** + * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. + * + * @param description the description value to set. + * @return the GalleryInner object itself. + */ + public GalleryInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the identifier property: Describes the gallery unique name. + * + * @return the identifier value. + */ + public GalleryIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Describes the gallery unique name. + * + * @param identifier the identifier value to set. + * @return the GalleryInner object itself. + */ + public GalleryInner withIdentifier(GalleryIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + public SharingProfile sharingProfile() { + return this.sharingProfile; + } + + /** + * Set the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @param sharingProfile the sharingProfile value to set. + * @return the GalleryInner object itself. + */ + public GalleryInner withSharingProfile(SharingProfile sharingProfile) { + this.sharingProfile = sharingProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identifier() != null) { + identifier().validate(); + } + if (sharingProfile() != null) { + sharingProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.java new file mode 100644 index 0000000000000..2ff66a9c24c4c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive must not exist. + */ +@JsonFlatten +@Fluent +public class ImageInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageInner.class); + + /* + * The extended location of the Image. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The source virtual machine from which Image is created. + */ + @JsonProperty(value = "properties.sourceVirtualMachine") + private SubResource sourceVirtualMachine; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private ImageStorageProfile storageProfile; + + /* + * The provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies the HyperVGenerationType of the VirtualMachine created from + * the image. From API Version 2019-03-01 if the image source is a blob, + * then we need the user to specify the value, if the source is managed + * resource like disk or snapshot, we may require the user to specify the + * property if we cannot deduce it from the source managed resource. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGenerationTypes hyperVGeneration; + + /** + * Get the extendedLocation property: The extended location of the Image. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Image. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ImageInner object itself. + */ + public ImageInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + public SubResource sourceVirtualMachine() { + return this.sourceVirtualMachine; + } + + /** + * Set the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @param sourceVirtualMachine the sourceVirtualMachine value to set. + * @return the ImageInner object itself. + */ + public ImageInner withSourceVirtualMachine(SubResource sourceVirtualMachine) { + this.sourceVirtualMachine = sourceVirtualMachine; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public ImageStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the ImageInner object itself. + */ + public ImageInner withStorageProfile(ImageStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the ImageInner object itself. + */ + public ImageInner withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/LogAnalyticsOperationResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/LogAnalyticsOperationResultInner.java new file mode 100644 index 0000000000000..a9666c6e1473c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/LogAnalyticsOperationResultInner.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOutput; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LogAnalytics operation status response. */ +@Immutable +public final class LogAnalyticsOperationResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsOperationResultInner.class); + + /* + * LogAnalyticsOutput + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private LogAnalyticsOutput properties; + + /** + * Get the properties property: LogAnalyticsOutput. + * + * @return the properties value. + */ + public LogAnalyticsOutput properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java new file mode 100644 index 0000000000000..75c2df20f2f5f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSFamilyInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.OSFamilyProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service OS family. */ +@Fluent +public final class OSFamilyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSFamilyInner.class); + + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * OS family properties. + */ + @JsonProperty(value = "properties") + private OSFamilyProperties properties; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: OS family properties. + * + * @return the properties value. + */ + public OSFamilyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: OS family properties. + * + * @param properties the properties value to set. + * @return the OSFamilyInner object itself. + */ + public OSFamilyInner withProperties(OSFamilyProperties properties) { + this.properties = properties; + 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java new file mode 100644 index 0000000000000..8e7dae290b04e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/OSVersionInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.OSVersionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service OS version. */ +@Fluent +public final class OSVersionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSVersionInner.class); + + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * OS version properties. + */ + @JsonProperty(value = "properties") + private OSVersionProperties properties; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: OS version properties. + * + * @return the properties value. + */ + public OSVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: OS version properties. + * + * @param properties the properties value to set. + * @return the OSVersionInner object itself. + */ + public OSVersionInner withProperties(OSVersionProperties properties) { + this.properties = properties; + 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..7dfd22a6397ca --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * DiskAccess and Virtual Network. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between DiskAccess and Virtual Network. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between DiskAccess and Virtual Network. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..b87ceb6fe93f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateLinkResourceListResultInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupInner.java new file mode 100644 index 0000000000000..6cb6f48258784 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ProximityPlacementGroupInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import com.azure.resourcemanager.compute.generated.models.SubResourceWithColocationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Specifies information about the proximity placement group. */ +@JsonFlatten +@Fluent +public class ProximityPlacementGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupInner.class); + + /* + * Specifies the type of the proximity placement group.

Possible + * values are:

**Standard** : Co-locate resources within an Azure + * region or Availability Zone.

**Ultra** : For future use. + */ + @JsonProperty(value = "properties.proximityPlacementGroupType") + private ProximityPlacementGroupType proximityPlacementGroupType; + + /* + * A list of references to all virtual machines in the proximity placement + * group. + */ + @JsonProperty(value = "properties.virtualMachines", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachines; + + /* + * A list of references to all virtual machine scale sets in the proximity + * placement group. + */ + @JsonProperty(value = "properties.virtualMachineScaleSets", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachineScaleSets; + + /* + * A list of references to all availability sets in the proximity placement + * group. + */ + @JsonProperty(value = "properties.availabilitySets", access = JsonProperty.Access.WRITE_ONLY) + private List availabilitySets; + + /* + * Describes colocation status of the Proximity Placement Group. + */ + @JsonProperty(value = "properties.colocationStatus") + private InstanceViewStatus colocationStatus; + + /** + * Get the proximityPlacementGroupType property: Specifies the type of the proximity placement group. + * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure + * region or Availability Zone. <br><br> **Ultra** : For future use. + * + * @return the proximityPlacementGroupType value. + */ + public ProximityPlacementGroupType proximityPlacementGroupType() { + return this.proximityPlacementGroupType; + } + + /** + * Set the proximityPlacementGroupType property: Specifies the type of the proximity placement group. + * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure + * region or Availability Zone. <br><br> **Ultra** : For future use. + * + * @param proximityPlacementGroupType the proximityPlacementGroupType value to set. + * @return the ProximityPlacementGroupInner object itself. + */ + public ProximityPlacementGroupInner withProximityPlacementGroupType( + ProximityPlacementGroupType proximityPlacementGroupType) { + this.proximityPlacementGroupType = proximityPlacementGroupType; + return this; + } + + /** + * Get the virtualMachines property: A list of references to all virtual machines in the proximity placement group. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Get the virtualMachineScaleSets property: A list of references to all virtual machine scale sets in the proximity + * placement group. + * + * @return the virtualMachineScaleSets value. + */ + public List virtualMachineScaleSets() { + return this.virtualMachineScaleSets; + } + + /** + * Get the availabilitySets property: A list of references to all availability sets in the proximity placement + * group. + * + * @return the availabilitySets value. + */ + public List availabilitySets() { + return this.availabilitySets; + } + + /** + * Get the colocationStatus property: Describes colocation status of the Proximity Placement Group. + * + * @return the colocationStatus value. + */ + public InstanceViewStatus colocationStatus() { + return this.colocationStatus; + } + + /** + * Set the colocationStatus property: Describes colocation status of the Proximity Placement Group. + * + * @param colocationStatus the colocationStatus value to set. + * @return the ProximityPlacementGroupInner object itself. + */ + public ProximityPlacementGroupInner withColocationStatus(InstanceViewStatus colocationStatus) { + this.colocationStatus = colocationStatus; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProximityPlacementGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProximityPlacementGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + if (virtualMachineScaleSets() != null) { + virtualMachineScaleSets().forEach(e -> e.validate()); + } + if (availabilitySets() != null) { + availabilitySets().forEach(e -> e.validate()); + } + if (colocationStatus() != null) { + colocationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.java new file mode 100644 index 0000000000000..08f0843b9258e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RecoveryWalkResponseInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response after calling a manual recovery walk. */ +@Immutable +public final class RecoveryWalkResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryWalkResponseInner.class); + + /* + * Whether the recovery walk was performed + */ + @JsonProperty(value = "walkPerformed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean walkPerformed; + + /* + * The next update domain that needs to be walked. Null means walk spanning + * all update domains has been completed + */ + @JsonProperty(value = "nextPlatformUpdateDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer nextPlatformUpdateDomain; + + /** + * Get the walkPerformed property: Whether the recovery walk was performed. + * + * @return the walkPerformed value. + */ + public Boolean walkPerformed() { + return this.walkPerformed; + } + + /** + * Get the nextPlatformUpdateDomain property: The next update domain that needs to be walked. Null means walk + * spanning all update domains has been completed. + * + * @return the nextPlatformUpdateDomain value. + */ + public Integer nextPlatformUpdateDomain() { + return this.nextPlatformUpdateDomain; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java new file mode 100644 index 0000000000000..5c934cfe0091a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ResourceSkuInner.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCapacity; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCosts; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available Compute SKU. */ +@Immutable +public final class ResourceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuInner.class); + + /* + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Specifies the tier of virtual machines in a scale set.

+ * Possible Values:

**Standard**

**Basic** + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /* + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /* + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Specifies the number of virtual machines in the scale set. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /* + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * A list of locations and availability zones in those locations where the + * SKU is available. + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /* + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the size property: The Size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The Family of this particular SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java new file mode 100644 index 0000000000000..eacfaf23ca200 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointCollectionInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Create or update Restore Point collection parameters. */ +@JsonFlatten +@Fluent +public class RestorePointCollectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointCollectionInner.class); + + /* + * The properties of the source resource that this restore point collection + * is created from. + */ + @JsonProperty(value = "properties.source") + private RestorePointCollectionSourceProperties source; + + /* + * The provisioning state of the restore point collection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique id of the restore point collection. + */ + @JsonProperty(value = "properties.restorePointCollectionId", access = JsonProperty.Access.WRITE_ONLY) + private String restorePointCollectionId; + + /* + * A list containing all restore points created under this restore point + * collection. + */ + @JsonProperty(value = "properties.restorePoints", access = JsonProperty.Access.WRITE_ONLY) + private List restorePoints; + + /** + * Get the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + public RestorePointCollectionSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @param source the source value to set. + * @return the RestorePointCollectionInner object itself. + */ + public RestorePointCollectionInner withSource(RestorePointCollectionSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + public String restorePointCollectionId() { + return this.restorePointCollectionId; + } + + /** + * Get the restorePoints property: A list containing all restore points created under this restore point collection. + * + * @return the restorePoints value. + */ + public List restorePoints() { + return this.restorePoints; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (restorePoints() != null) { + restorePoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java new file mode 100644 index 0000000000000..b5e90595cfd5e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RestorePointInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ConsistencyModeTypes; +import com.azure.resourcemanager.compute.generated.models.RestorePointProvisioningDetails; +import com.azure.resourcemanager.compute.generated.models.RestorePointSourceMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Restore Point details. */ +@JsonFlatten +@Fluent +public class RestorePointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointInner.class); + + /* + * List of disk resource ids that the customer wishes to exclude from the + * restore point. If no disks are specified, all disks will be included. + */ + @JsonProperty(value = "properties.excludeDisks") + private List excludeDisks; + + /* + * Gets the details of the VM captured at the time of the restore point + * creation. + */ + @JsonProperty(value = "properties.sourceMetadata", access = JsonProperty.Access.WRITE_ONLY) + private RestorePointSourceMetadata sourceMetadata; + + /* + * Gets the provisioning state of the restore point. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Gets the consistency mode for the restore point. Please refer to + * https://aka.ms/RestorePoints for more details. + */ + @JsonProperty(value = "properties.consistencyMode", access = JsonProperty.Access.WRITE_ONLY) + private ConsistencyModeTypes consistencyMode; + + /* + * Gets the provisioning details set by the server during Create restore + * point operation. + */ + @JsonProperty(value = "properties.provisioningDetails", access = JsonProperty.Access.WRITE_ONLY) + private RestorePointProvisioningDetails provisioningDetails; + + /** + * Get the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @return the excludeDisks value. + */ + public List excludeDisks() { + return this.excludeDisks; + } + + /** + * Set the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @param excludeDisks the excludeDisks value to set. + * @return the RestorePointInner object itself. + */ + public RestorePointInner withExcludeDisks(List excludeDisks) { + this.excludeDisks = excludeDisks; + return this; + } + + /** + * Get the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @return the sourceMetadata value. + */ + public RestorePointSourceMetadata sourceMetadata() { + return this.sourceMetadata; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the restore point. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the consistencyMode property: Gets the consistency mode for the restore point. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @return the consistencyMode value. + */ + public ConsistencyModeTypes consistencyMode() { + return this.consistencyMode; + } + + /** + * Get the provisioningDetails property: Gets the provisioning details set by the server during Create restore point + * operation. + * + * @return the provisioningDetails value. + */ + public RestorePointProvisioningDetails provisioningDetails() { + return this.provisioningDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (excludeDisks() != null) { + excludeDisks().forEach(e -> e.validate()); + } + if (sourceMetadata() != null) { + sourceMetadata().validate(); + } + if (provisioningDetails() != null) { + provisioningDetails().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RetrieveBootDiagnosticsDataResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RetrieveBootDiagnosticsDataResultInner.java new file mode 100644 index 0000000000000..a0a680f735570 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RetrieveBootDiagnosticsDataResultInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAS URIs of the console screenshot and serial log blobs. */ +@Immutable +public final class RetrieveBootDiagnosticsDataResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetrieveBootDiagnosticsDataResultInner.class); + + /* + * The console screenshot blob URI + */ + @JsonProperty(value = "consoleScreenshotBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String consoleScreenshotBlobUri; + + /* + * The serial console log blob URI. + */ + @JsonProperty(value = "serialConsoleLogBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String serialConsoleLogBlobUri; + + /** + * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. + * + * @return the consoleScreenshotBlobUri value. + */ + public String consoleScreenshotBlobUri() { + return this.consoleScreenshotBlobUri; + } + + /** + * Get the serialConsoleLogBlobUri property: The serial console log blob URI. + * + * @return the serialConsoleLogBlobUri value. + */ + public String serialConsoleLogBlobUri() { + return this.serialConsoleLogBlobUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java new file mode 100644 index 0000000000000..56aa6118b9c4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The RoleInstance model. */ +@Fluent +public final class RoleInstanceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstanceInner.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource Name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource Type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource Location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /* + * The sku property. + */ + @JsonProperty(value = "sku") + private InstanceSku sku; + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private RoleInstancePropertiesInner properties; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the sku property: The sku property. + * + * @return the sku value. + */ + public InstanceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku property. + * + * @param sku the sku value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withSku(InstanceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public RoleInstancePropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the RoleInstanceInner object itself. + */ + public RoleInstanceInner withProperties(RoleInstancePropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.java new file mode 100644 index 0000000000000..d910a842f95f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstancePropertiesInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceNetworkProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RoleInstanceProperties model. */ +@Fluent +public final class RoleInstancePropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstancePropertiesInner.class); + + /* + * Describes the network profile for the role instance. + */ + @JsonProperty(value = "networkProfile") + private RoleInstanceNetworkProfile networkProfile; + + /* + * The instance view of the role instance. + */ + @JsonProperty(value = "instanceView") + private RoleInstanceViewInner instanceView; + + /** + * Get the networkProfile property: Describes the network profile for the role instance. + * + * @return the networkProfile value. + */ + public RoleInstanceNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Describes the network profile for the role instance. + * + * @param networkProfile the networkProfile value to set. + * @return the RoleInstancePropertiesInner object itself. + */ + public RoleInstancePropertiesInner withNetworkProfile(RoleInstanceNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the instanceView property: The instance view of the role instance. + * + * @return the instanceView value. + */ + public RoleInstanceViewInner instanceView() { + return this.instanceView; + } + + /** + * Set the instanceView property: The instance view of the role instance. + * + * @param instanceView the instanceView value to set. + * @return the RoleInstancePropertiesInner object itself. + */ + public RoleInstancePropertiesInner withInstanceView(RoleInstanceViewInner instanceView) { + this.instanceView = instanceView; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkProfile() != null) { + networkProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java new file mode 100644 index 0000000000000..ad997bb66968c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RoleInstanceViewInner.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the role instance. */ +@Immutable +public final class RoleInstanceViewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstanceViewInner.class); + + /* + * The Update Domain. + */ + @JsonProperty(value = "platformUpdateDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer platformUpdateDomain; + + /* + * The Fault Domain. + */ + @JsonProperty(value = "platformFaultDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer platformFaultDomain; + + /* + * Specifies a unique identifier generated internally for the cloud service + * associated with this role instance.

NOTE: If you are using + * Azure Diagnostics extension, this property can be used as 'DeploymentId' + * for querying details. + */ + @JsonProperty(value = "privateId", access = JsonProperty.Access.WRITE_ONLY) + private String privateId; + + /* + * The statuses property. + */ + @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** + * Get the platformUpdateDomain property: The Update Domain. + * + * @return the platformUpdateDomain value. + */ + public Integer platformUpdateDomain() { + return this.platformUpdateDomain; + } + + /** + * Get the platformFaultDomain property: The Fault Domain. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Get the privateId property: Specifies a unique identifier generated internally for the cloud service associated + * with this role instance. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this + * property can be used as 'DeploymentId' for querying details. + * + * @return the privateId value. + */ + public String privateId() { + return this.privateId; + } + + /** + * Get the statuses property: The statuses property. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java new file mode 100644 index 0000000000000..42edea1c46a6d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RollingUpgradeStatusInfoInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeProgressInfo; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeRunningStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The status of the latest virtual machine scale set rolling upgrade. */ +@JsonFlatten +@Fluent +public class RollingUpgradeStatusInfoInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeStatusInfoInner.class); + + /* + * The rolling upgrade policies applied for this upgrade. + */ + @JsonProperty(value = "properties.policy", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradePolicy policy; + + /* + * Information about the current running state of the overall upgrade. + */ + @JsonProperty(value = "properties.runningStatus", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeRunningStatus runningStatus; + + /* + * Information about the number of virtual machine instances in each + * upgrade state. + */ + @JsonProperty(value = "properties.progress", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeProgressInfo progress; + + /* + * Error details for this upgrade, if there are any. + */ + @JsonProperty(value = "properties.error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Get the policy property: The rolling upgrade policies applied for this upgrade. + * + * @return the policy value. + */ + public RollingUpgradePolicy policy() { + return this.policy; + } + + /** + * Get the runningStatus property: Information about the current running state of the overall upgrade. + * + * @return the runningStatus value. + */ + public RollingUpgradeRunningStatus runningStatus() { + return this.runningStatus; + } + + /** + * Get the progress property: Information about the number of virtual machine instances in each upgrade state. + * + * @return the progress value. + */ + public RollingUpgradeProgressInfo progress() { + return this.progress; + } + + /** + * Get the error property: Error details for this upgrade, if there are any. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** {@inheritDoc} */ + @Override + public RollingUpgradeStatusInfoInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RollingUpgradeStatusInfoInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policy() != null) { + policy().validate(); + } + if (runningStatus() != null) { + runningStatus().validate(); + } + if (progress() != null) { + progress().validate(); + } + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentBaseInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentBaseInner.java new file mode 100644 index 0000000000000..08a70b8292c9b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentBaseInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Run Command metadata. */ +@Fluent +public class RunCommandDocumentBaseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandDocumentBaseInner.class); + + /* + * The VM run command schema. + */ + @JsonProperty(value = "$schema", required = true) + private String schema; + + /* + * The VM run command id. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * The Operating System type. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * The VM run command label. + */ + @JsonProperty(value = "label", required = true) + private String label; + + /* + * The VM run command description. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get the schema property: The VM run command schema. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: The VM run command schema. + * + * @param schema the schema value to set. + * @return the RunCommandDocumentBaseInner object itself. + */ + public RunCommandDocumentBaseInner withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * Get the id property: The VM run command id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The VM run command id. + * + * @param id the id value to set. + * @return the RunCommandDocumentBaseInner object itself. + */ + public RunCommandDocumentBaseInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The Operating System type. + * + * @param osType the osType value to set. + * @return the RunCommandDocumentBaseInner object itself. + */ + public RunCommandDocumentBaseInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the label property: The VM run command label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: The VM run command label. + * + * @param label the label value to set. + * @return the RunCommandDocumentBaseInner object itself. + */ + public RunCommandDocumentBaseInner withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the description property: The VM run command description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The VM run command description. + * + * @param description the description value to set. + * @return the RunCommandDocumentBaseInner object itself. + */ + public RunCommandDocumentBaseInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schema() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schema in model RunCommandDocumentBaseInner")); + } + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model RunCommandDocumentBaseInner")); + } + if (osType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model RunCommandDocumentBaseInner")); + } + if (label() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property label in model RunCommandDocumentBaseInner")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model RunCommandDocumentBaseInner")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentInner.java new file mode 100644 index 0000000000000..091365d0c34a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandDocumentInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandParameterDefinition; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the properties of a Run Command. */ +@Fluent +public final class RunCommandDocumentInner extends RunCommandDocumentBaseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandDocumentInner.class); + + /* + * The script to be executed. + */ + @JsonProperty(value = "script", required = true) + private List script; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "parameters") + private List parameters; + + /** + * Get the script property: The script to be executed. + * + * @return the script value. + */ + public List script() { + return this.script; + } + + /** + * Set the script property: The script to be executed. + * + * @param script the script value to set. + * @return the RunCommandDocumentInner object itself. + */ + public RunCommandDocumentInner withScript(List script) { + this.script = script; + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters used by the script. + * + * @param parameters the parameters value to set. + * @return the RunCommandDocumentInner object itself. + */ + public RunCommandDocumentInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public RunCommandDocumentInner withSchema(String schema) { + super.withSchema(schema); + return this; + } + + /** {@inheritDoc} */ + @Override + public RunCommandDocumentInner withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RunCommandDocumentInner withOsType(OperatingSystemTypes osType) { + super.withOsType(osType); + return this; + } + + /** {@inheritDoc} */ + @Override + public RunCommandDocumentInner withLabel(String label) { + super.withLabel(label); + return this; + } + + /** {@inheritDoc} */ + @Override + public RunCommandDocumentInner withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (script() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property script in model RunCommandDocumentInner")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandResultInner.java new file mode 100644 index 0000000000000..f500f75596159 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/RunCommandResultInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RunCommandResult model. */ +@Fluent +public final class RunCommandResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandResultInner.class); + + /* + * Run command operation response. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Run command operation response. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Run command operation response. + * + * @param value the value value to set. + * @return the RunCommandResultInner object itself. + */ + public RunCommandResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageInner.java new file mode 100644 index 0000000000000..5e8107c55cc1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageInner.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Disallowed; +import com.azure.resourcemanager.compute.generated.models.GalleryImageFeature; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.ImagePurchasePlan; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PirSharedGalleryResource; +import com.azure.resourcemanager.compute.generated.models.RecommendedMachineConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Specifies information about the gallery image definition that you want to create or update. */ +@JsonFlatten +@Fluent +public class SharedGalleryImageInner extends PirSharedGalleryResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImageInner.class); + + /* + * This property allows you to specify the type of the OS that is included + * in the disk when creating a VM from a managed image.

Possible + * values are:

**Windows**

**Linux** + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines + * created under this image are 'Generalized' or 'Specialized'. + */ + @JsonProperty(value = "properties.osState") + private OperatingSystemStateTypes osState; + + /* + * The end of life date of the gallery image definition. This property can + * be used for decommissioning purposes. This property is updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "properties.identifier") + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this + * Image Definition. These properties are updatable. + */ + @JsonProperty(value = "properties.recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "properties.disallowed") + private Disallowed disallowed; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "properties.features") + private List features; + + /* + * Describes the gallery image definition purchase plan. This is used by + * marketplace images. + */ + @JsonProperty(value = "properties.purchasePlan") + private ImagePurchasePlan purchasePlan; + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @return the osState value. + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @param osState the osState value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withOsState(OperatingSystemStateTypes osState) { + this.osState = osState; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @return the recommended value. + */ + public RecommendedMachineConfiguration recommended() { + return this.recommended; + } + + /** + * Set the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @param recommended the recommended value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withRecommended(RecommendedMachineConfiguration recommended) { + this.recommended = recommended; + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.disallowed; + } + + /** + * Set the disallowed property: Describes the disallowed disk types. + * + * @param disallowed the disallowed value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withDisallowed(Disallowed disallowed) { + this.disallowed = disallowed; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: A list of gallery image features. + * + * @param features the features value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @return the purchasePlan value. + */ + public ImagePurchasePlan purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @param purchasePlan the purchasePlan value to set. + * @return the SharedGalleryImageInner object itself. + */ + public SharedGalleryImageInner withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryImageInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identifier() != null) { + identifier().validate(); + } + if (recommended() != null) { + recommended().validate(); + } + if (disallowed() != null) { + disallowed().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionInner.java new file mode 100644 index 0000000000000..192d68be295f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryImageVersionInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.PirSharedGalleryResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Specifies information about the gallery image version that you want to create or update. */ +@JsonFlatten +@Fluent +public class SharedGalleryImageVersionInner extends PirSharedGalleryResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImageVersionInner.class); + + /* + * The published date of the gallery image version Definition. This + * property can be used for decommissioning purposes. This property is + * updatable. + */ + @JsonProperty(value = "properties.publishedDate") + private OffsetDateTime publishedDate; + + /* + * The end of life date of the gallery image version Definition. This + * property can be used for decommissioning purposes. This property is + * updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /** + * Get the publishedDate property: The published date of the gallery image version Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @return the publishedDate value. + */ + public OffsetDateTime publishedDate() { + return this.publishedDate; + } + + /** + * Set the publishedDate property: The published date of the gallery image version Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @param publishedDate the publishedDate value to set. + * @return the SharedGalleryImageVersionInner object itself. + */ + public SharedGalleryImageVersionInner withPublishedDate(OffsetDateTime publishedDate) { + this.publishedDate = publishedDate; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery image version Definition. This property can + * be used for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery image version Definition. This property can + * be used for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the SharedGalleryImageVersionInner object itself. + */ + public SharedGalleryImageVersionInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryImageVersionInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryInner.java new file mode 100644 index 0000000000000..25f78fbf37061 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharedGalleryInner.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.PirSharedGalleryResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Specifies information about the Shared Gallery that you want to create or update. */ +@Fluent +public final class SharedGalleryInner extends PirSharedGalleryResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryInner.class); + + /** {@inheritDoc} */ + @Override + public SharedGalleryInner withUniqueId(String uniqueId) { + super.withUniqueId(uniqueId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharingUpdateInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharingUpdateInner.java new file mode 100644 index 0000000000000..6e643d8d317ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SharingUpdateInner.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup; +import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies information about the gallery sharing profile update. */ +@Fluent +public final class SharingUpdateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharingUpdateInner.class); + + /* + * This property allows you to specify the operation type of gallery + * sharing update.

Possible values are:

**Add**

+ * **Remove**

**Reset** + */ + @JsonProperty(value = "operationType", required = true) + private SharingUpdateOperationTypes operationType; + + /* + * A list of sharing profile groups. + */ + @JsonProperty(value = "groups") + private List groups; + + /** + * Get the operationType property: This property allows you to specify the operation type of gallery sharing update. + * <br><br> Possible values are: <br><br> **Add** <br><br> **Remove** + * <br><br> **Reset**. + * + * @return the operationType value. + */ + public SharingUpdateOperationTypes operationType() { + return this.operationType; + } + + /** + * Set the operationType property: This property allows you to specify the operation type of gallery sharing update. + * <br><br> Possible values are: <br><br> **Add** <br><br> **Remove** + * <br><br> **Reset**. + * + * @param operationType the operationType value to set. + * @return the SharingUpdateInner object itself. + */ + public SharingUpdateInner withOperationType(SharingUpdateOperationTypes operationType) { + this.operationType = operationType; + return this; + } + + /** + * Get the groups property: A list of sharing profile groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: A list of sharing profile groups. + * + * @param groups the groups value to set. + * @return the SharingUpdateInner object itself. + */ + public SharingUpdateInner withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operationType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operationType in model SharingUpdateInner")); + } + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java new file mode 100644 index 0000000000000..6b86782e4c2ff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.SnapshotSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Snapshot resource. */ +@JsonFlatten +@Fluent +public class SnapshotInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotInner.class); + + /* + * Unused. Always Null. + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; + + /* + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or + * Standard_ZRS. This is an optional parameter for incremental snapshot and + * the default behavior is the SKU will be set to the same sku as the + * previous snapshot + */ + @JsonProperty(value = "sku") + private SnapshotSku sku; + + /* + * The extended location where the snapshot will be created. Extended + * location cannot be changed. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The time when the snapshot was created. + */ + @JsonProperty(value = "properties.timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /* + * The Operating System type. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * Purchase plan information for the image from which the source disk for + * the snapshot was originally created. + */ + @JsonProperty(value = "properties.purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * Disk source information. CreationData information cannot be changed + * after the disk has been created. + */ + @JsonProperty(value = "properties.creationData") + private CreationData creationData; + + /* + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /* + * The size of the disk in bytes. This field is read only. + */ + @JsonProperty(value = "properties.diskSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long diskSizeBytes; + + /* + * The state of the snapshot. + */ + @JsonProperty(value = "properties.diskState", access = JsonProperty.Access.WRITE_ONLY) + private DiskState diskState; + + /* + * Unique Guid identifying the resource. + */ + @JsonProperty(value = "properties.uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /* + * Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * The disk provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Whether a snapshot is incremental. Incremental snapshots on the same + * disk occupy less space than full snapshots and can be diffed. + */ + @JsonProperty(value = "properties.incremental") + private Boolean incremental; + + /* + * Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "properties.networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "properties.diskAccessId") + private String diskAccessId; + + /* + * Indicates the OS on a snapshot supports hibernation. + */ + @JsonProperty(value = "properties.supportsHibernation") + private Boolean supportsHibernation; + + /** + * Get the managedBy property: Unused. Always Null. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Get the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an + * optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * + * @return the sku value. + */ + public SnapshotSku sku() { + return this.sku; + } + + /** + * Set the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an + * optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * + * @param sku the sku value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSku(SnapshotSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the extendedLocation property: The extended location where the snapshot will be created. Extended location + * cannot be changed. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location where the snapshot will be created. Extended location + * cannot be changed. + * + * @param extendedLocation the extendedLocation value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the timeCreated property: The time when the snapshot was created. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Get the osType property: The Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: The Operating System type. + * + * @param osType the osType value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the purchasePlan property: Purchase plan information for the image from which the source disk for the + * snapshot was originally created. + * + * @return the purchasePlan value. + */ + public PurchasePlanAutoGenerated purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Purchase plan information for the image from which the source disk for the + * snapshot was originally created. + * + * @param purchasePlan the purchasePlan value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the creationData property: Disk source information. CreationData information cannot be changed after the disk + * has been created. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: Disk source information. CreationData information cannot be changed after the disk + * has been created. + * + * @param creationData the creationData value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the diskSizeBytes property: The size of the disk in bytes. This field is read only. + * + * @return the diskSizeBytes value. + */ + public Long diskSizeBytes() { + return this.diskSizeBytes; + } + + /** + * Get the diskState property: The state of the snapshot. + * + * @return the diskState value. + */ + public DiskState diskState() { + return this.diskState; + } + + /** + * Get the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.encryptionSettingsCollection; + } + + /** + * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + this.encryptionSettingsCollection = encryptionSettingsCollection; + return this; + } + + /** + * Get the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy + * less space than full snapshots and can be diffed. + * + * @return the incremental value. + */ + public Boolean incremental() { + return this.incremental; + } + + /** + * Set the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy + * less space than full snapshots and can be diffed. + * + * @param incremental the incremental value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withIncremental(Boolean incremental) { + this.incremental = incremental; + return this; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @param encryption the encryption value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.networkAccessPolicy; + } + + /** + * Set the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @param networkAccessPolicy the networkAccessPolicy value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + this.networkAccessPolicy = networkAccessPolicy; + return this; + } + + /** + * Get the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + public String diskAccessId() { + return this.diskAccessId; + } + + /** + * Set the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @param diskAccessId the diskAccessId value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (creationData() != null) { + creationData().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java new file mode 100644 index 0000000000000..c642df87a4dc3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyGenerateKeyPairResultInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response from generation of an SSH key pair. */ +@Fluent +public final class SshPublicKeyGenerateKeyPairResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyGenerateKeyPairResultInner.class); + + /* + * Private key portion of the key pair used to authenticate to a virtual + * machine through ssh. The private key is returned in RFC3447 format and + * should be treated as a secret. + */ + @JsonProperty(value = "privateKey", required = true) + private String privateKey; + + /* + * Public key portion of the key pair used to authenticate to a virtual + * machine through ssh. The public key is in ssh-rsa format. + */ + @JsonProperty(value = "publicKey", required = true) + private String publicKey; + + /* + * The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine + * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine + * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. + * + * @param privateKey the privateKey value to set. + * @return the SshPublicKeyGenerateKeyPairResultInner object itself. + */ + public SshPublicKeyGenerateKeyPairResultInner withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through + * ssh. The public key is in ssh-rsa format. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through + * ssh. The public key is in ssh-rsa format. + * + * @param publicKey the publicKey value to set. + * @return the SshPublicKeyGenerateKeyPairResultInner object itself. + */ + public SshPublicKeyGenerateKeyPairResultInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + * + * @param id the id value to set. + * @return the SshPublicKeyGenerateKeyPairResultInner object itself. + */ + public SshPublicKeyGenerateKeyPairResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateKey in model SshPublicKeyGenerateKeyPairResultInner")); + } + if (publicKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicKey in model SshPublicKeyGenerateKeyPairResultInner")); + } + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property id in model SshPublicKeyGenerateKeyPairResultInner")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceInner.java new file mode 100644 index 0000000000000..8b89b3182146c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SshPublicKeyResourceInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the SSH public key. */ +@JsonFlatten +@Fluent +public class SshPublicKeyResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyResourceInner.class); + + /* + * SSH public key used to authenticate to a virtual machine through ssh. If + * this property is not initially provided when the resource is created, + * the publicKey property will be populated when generateKeyPair is called. + * If the public key is provided upon resource creation, the provided + * public key needs to be at least 2048-bit and in ssh-rsa format. + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /** + * Get the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @param publicKey the publicKey value to set. + * @return the SshPublicKeyResourceInner object itself. + */ + public SshPublicKeyResourceInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.java new file mode 100644 index 0000000000000..94b6a54474039 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpdateDomainInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines an update domain for the cloud service. */ +@Immutable +public final class UpdateDomainInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDomainInner.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource Name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java new file mode 100644 index 0000000000000..67adc2e566e68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UpgradeOperationHistoricalStatusInfoInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfoProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Machine Scale Set OS Upgrade History operation response. */ +@Immutable +public final class UpgradeOperationHistoricalStatusInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoricalStatusInfoInner.class); + + /* + * Information about the properties of the upgrade operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationHistoricalStatusInfoProperties properties; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Resource location + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the properties property: Information about the properties of the upgrade operation. + * + * @return the properties value. + */ + public UpgradeOperationHistoricalStatusInfoProperties properties() { + return this.properties; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..158798a872b36 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/UsageInner.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.UsageName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Compute Resource Usage. */ +@Fluent +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * An enum describing the unit of usage measurement. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /* + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", required = true) + private int currentValue; + + /* + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** Creates an instance of UsageInner class. */ + public UsageInner() { + unit = "Count"; + } + + /** + * Get the unit property: An enum describing the unit of usage measurement. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: An enum describing the unit of usage measurement. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + public int currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current usage of the resource. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(int currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The maximum permitted usage of the resource. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name of the type of usage. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.java new file mode 100644 index 0000000000000..f4cec98529c22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineAssessPatchesResultInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.PatchOperationStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSoftwarePatchProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of an AssessPatches result. */ +@Immutable +public final class VirtualMachineAssessPatchesResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAssessPatchesResultInner.class); + + /* + * The overall success or failure status of the operation. It remains + * "InProgress" until the operation completes. At that point it will become + * "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + */ + @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String assessmentActivityId; + + /* + * The overall reboot status of the VM. It will be true when partially + * installed patches require a reboot to complete installation but the + * reboot has not yet occurred. + */ + @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) + private Boolean rebootPending; + + /* + * The number of critical or security patches that have been detected as + * available and not yet installed. + */ + @JsonProperty(value = "criticalAndSecurityPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer criticalAndSecurityPatchCount; + + /* + * The number of all available patches excluding critical and security. + */ + @JsonProperty(value = "otherPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer otherPatchCount; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /* + * The list of patches that have been detected as available for + * installation. + */ + @JsonProperty(value = "availablePatches", access = JsonProperty.Access.WRITE_ONLY) + private List availablePatches; + + /* + * The errors that were encountered during execution of the operation. The + * details array contains the list of them. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the assessmentActivityId property: The activity ID of the operation that produced this result. It is used to + * correlate across CRP and extension logs. + * + * @return the assessmentActivityId value. + */ + public String assessmentActivityId() { + return this.assessmentActivityId; + } + + /** + * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed + * patches require a reboot to complete installation but the reboot has not yet occurred. + * + * @return the rebootPending value. + */ + public Boolean rebootPending() { + return this.rebootPending; + } + + /** + * Get the criticalAndSecurityPatchCount property: The number of critical or security patches that have been + * detected as available and not yet installed. + * + * @return the criticalAndSecurityPatchCount value. + */ + public Integer criticalAndSecurityPatchCount() { + return this.criticalAndSecurityPatchCount; + } + + /** + * Get the otherPatchCount property: The number of all available patches excluding critical and security. + * + * @return the otherPatchCount value. + */ + public Integer otherPatchCount() { + return this.otherPatchCount; + } + + /** + * Get the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Get the availablePatches property: The list of patches that have been detected as available for installation. + * + * @return the availablePatches value. + */ + public List availablePatches() { + return this.availablePatches; + } + + /** + * Get the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availablePatches() != null) { + availablePatches().forEach(e -> e.validate()); + } + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java new file mode 100644 index 0000000000000..c4ea1f230a136 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineCaptureResultInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output of virtual machine capture operation. */ +@Fluent +public final class VirtualMachineCaptureResultInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineCaptureResultInner.class); + + /* + * the schema of the captured virtual machine + */ + @JsonProperty(value = "$schema", access = JsonProperty.Access.WRITE_ONLY) + private String schema; + + /* + * the version of the content + */ + @JsonProperty(value = "contentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String contentVersion; + + /* + * parameters of the captured virtual machine + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private Object parameters; + + /* + * a list of resource items of the captured virtual machine + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; + + /** + * Get the schema property: the schema of the captured virtual machine. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Get the contentVersion property: the version of the content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Get the parameters property: parameters of the captured virtual machine. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Get the resources property: a list of resource items of the captured virtual machine. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineCaptureResultInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.java new file mode 100644 index 0000000000000..006c670c53e77 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionImageInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Extension Image. */ +@JsonFlatten +@Fluent +public class VirtualMachineExtensionImageInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImageInner.class); + + /* + * The operating system this extension supports. + */ + @JsonProperty(value = "properties.operatingSystem") + private String operatingSystem; + + /* + * The type of role (IaaS or PaaS) this extension supports. + */ + @JsonProperty(value = "properties.computeRole") + private String computeRole; + + /* + * The schema defined by publisher, where extension consumers should + * provide settings in a matching schema. + */ + @JsonProperty(value = "properties.handlerSchema") + private String handlerSchema; + + /* + * Whether the extension can be used on xRP VMScaleSets. By default + * existing extensions are usable on scalesets, but there might be cases + * where a publisher wants to explicitly indicate the extension is only + * enabled for CRP VMs but not VMSS. + */ + @JsonProperty(value = "properties.vmScaleSetEnabled") + private Boolean vmScaleSetEnabled; + + /* + * Whether the handler can support multiple extensions. + */ + @JsonProperty(value = "properties.supportsMultipleExtensions") + private Boolean supportsMultipleExtensions; + + /** + * Get the operatingSystem property: The operating system this extension supports. + * + * @return the operatingSystem value. + */ + public String operatingSystem() { + return this.operatingSystem; + } + + /** + * Set the operatingSystem property: The operating system this extension supports. + * + * @param operatingSystem the operatingSystem value to set. + * @return the VirtualMachineExtensionImageInner object itself. + */ + public VirtualMachineExtensionImageInner withOperatingSystem(String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Get the computeRole property: The type of role (IaaS or PaaS) this extension supports. + * + * @return the computeRole value. + */ + public String computeRole() { + return this.computeRole; + } + + /** + * Set the computeRole property: The type of role (IaaS or PaaS) this extension supports. + * + * @param computeRole the computeRole value to set. + * @return the VirtualMachineExtensionImageInner object itself. + */ + public VirtualMachineExtensionImageInner withComputeRole(String computeRole) { + this.computeRole = computeRole; + return this; + } + + /** + * Get the handlerSchema property: The schema defined by publisher, where extension consumers should provide + * settings in a matching schema. + * + * @return the handlerSchema value. + */ + public String handlerSchema() { + return this.handlerSchema; + } + + /** + * Set the handlerSchema property: The schema defined by publisher, where extension consumers should provide + * settings in a matching schema. + * + * @param handlerSchema the handlerSchema value to set. + * @return the VirtualMachineExtensionImageInner object itself. + */ + public VirtualMachineExtensionImageInner withHandlerSchema(String handlerSchema) { + this.handlerSchema = handlerSchema; + return this; + } + + /** + * Get the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing + * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the + * extension is only enabled for CRP VMs but not VMSS. + * + * @return the vmScaleSetEnabled value. + */ + public Boolean vmScaleSetEnabled() { + return this.vmScaleSetEnabled; + } + + /** + * Set the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing + * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the + * extension is only enabled for CRP VMs but not VMSS. + * + * @param vmScaleSetEnabled the vmScaleSetEnabled value to set. + * @return the VirtualMachineExtensionImageInner object itself. + */ + public VirtualMachineExtensionImageInner withVmScaleSetEnabled(Boolean vmScaleSetEnabled) { + this.vmScaleSetEnabled = vmScaleSetEnabled; + return this; + } + + /** + * Get the supportsMultipleExtensions property: Whether the handler can support multiple extensions. + * + * @return the supportsMultipleExtensions value. + */ + public Boolean supportsMultipleExtensions() { + return this.supportsMultipleExtensions; + } + + /** + * Set the supportsMultipleExtensions property: Whether the handler can support multiple extensions. + * + * @param supportsMultipleExtensions the supportsMultipleExtensions value to set. + * @return the VirtualMachineExtensionImageInner object itself. + */ + public VirtualMachineExtensionImageInner withSupportsMultipleExtensions(Boolean supportsMultipleExtensions) { + this.supportsMultipleExtensions = supportsMultipleExtensions; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionInner.java new file mode 100644 index 0000000000000..0fb73d0d71e50 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionInner.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineExtensionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionInner.class); + + /* + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine extension instance view. + */ + @JsonProperty(value = "properties.instanceView") + private VirtualMachineExtensionInstanceView instanceView; + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the instanceView property: The virtual machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the VirtualMachineExtensionInner object itself. + */ + public VirtualMachineExtensionInner withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionsListResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionsListResultInner.java new file mode 100644 index 0000000000000..31a6799c5f641 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineExtensionsListResultInner.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.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Extension operation response. */ +@Fluent +public final class VirtualMachineExtensionsListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsListResultInner.class); + + /* + * The list of extensions + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of extensions. + * + * @param value the value value to set. + * @return the VirtualMachineExtensionsListResultInner object itself. + */ + public VirtualMachineExtensionsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageInner.java new file mode 100644 index 0000000000000..6901e52d3254a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageInner.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradeProperties; +import com.azure.resourcemanager.compute.generated.models.DataDiskImage; +import com.azure.resourcemanager.compute.generated.models.DisallowedConfiguration; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.OSDiskImage; +import com.azure.resourcemanager.compute.generated.models.PurchasePlan; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageFeature; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Image. */ +@JsonFlatten +@Fluent +public class VirtualMachineImageInner extends VirtualMachineImageResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageInner.class); + + /* + * Used for establishing the purchase context of any 3rd Party artifact + * through MarketPlace. + */ + @JsonProperty(value = "properties.plan") + private PurchasePlan plan; + + /* + * Contains the os disk image information. + */ + @JsonProperty(value = "properties.osDiskImage") + private OSDiskImage osDiskImage; + + /* + * The dataDiskImages property. + */ + @JsonProperty(value = "properties.dataDiskImages") + private List dataDiskImages; + + /* + * Describes automatic OS upgrade properties on the image. + */ + @JsonProperty(value = "properties.automaticOSUpgradeProperties") + private AutomaticOSUpgradeProperties automaticOSUpgradeProperties; + + /* + * Specifies the HyperVGeneration Type + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGenerationTypes hyperVGeneration; + + /* + * Specifies disallowed configuration for the VirtualMachine created from + * the image + */ + @JsonProperty(value = "properties.disallowed") + private DisallowedConfiguration disallowed; + + /* + * The features property. + */ + @JsonProperty(value = "properties.features") + private List features; + + /** + * Get the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + * + * @return the plan value. + */ + public PurchasePlan plan() { + return this.plan; + } + + /** + * Set the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + * + * @param plan the plan value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withPlan(PurchasePlan plan) { + this.plan = plan; + return this; + } + + /** + * Get the osDiskImage property: Contains the os disk image information. + * + * @return the osDiskImage value. + */ + public OSDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Set the osDiskImage property: Contains the os disk image information. + * + * @param osDiskImage the osDiskImage value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withOsDiskImage(OSDiskImage osDiskImage) { + this.osDiskImage = osDiskImage; + return this; + } + + /** + * Get the dataDiskImages property: The dataDiskImages property. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Set the dataDiskImages property: The dataDiskImages property. + * + * @param dataDiskImages the dataDiskImages value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withDataDiskImages(List dataDiskImages) { + this.dataDiskImages = dataDiskImages; + return this; + } + + /** + * Get the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. + * + * @return the automaticOSUpgradeProperties value. + */ + public AutomaticOSUpgradeProperties automaticOSUpgradeProperties() { + return this.automaticOSUpgradeProperties; + } + + /** + * Set the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. + * + * @param automaticOSUpgradeProperties the automaticOSUpgradeProperties value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withAutomaticOSUpgradeProperties( + AutomaticOSUpgradeProperties automaticOSUpgradeProperties) { + this.automaticOSUpgradeProperties = automaticOSUpgradeProperties; + return this; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGeneration Type. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGeneration Type. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. + * + * @return the disallowed value. + */ + public DisallowedConfiguration disallowed() { + return this.disallowed; + } + + /** + * Set the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. + * + * @param disallowed the disallowed value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withDisallowed(DisallowedConfiguration disallowed) { + this.disallowed = disallowed; + return this; + } + + /** + * Get the features property: The features property. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: The features property. + * + * @param features the features value to set. + * @return the VirtualMachineImageInner object itself. + */ + public VirtualMachineImageInner withFeatures(List features) { + this.features = features; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageInner withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageInner withExtendedLocation(ExtendedLocation extendedLocation) { + super.withExtendedLocation(extendedLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (plan() != null) { + plan().validate(); + } + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + if (automaticOSUpgradeProperties() != null) { + automaticOSUpgradeProperties().validate(); + } + if (disallowed() != null) { + disallowed().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageResourceInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageResourceInner.java new file mode 100644 index 0000000000000..765c39dfd1e79 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineImageResourceInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Virtual machine image resource information. */ +@Fluent +public class VirtualMachineImageResourceInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageResourceInner.class); + + /* + * The name of the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The supported Azure location of the resource. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * Specifies the tags that are assigned to the virtual machine. For more + * information about using tags, see [Using tags to organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The extended location of the Virtual Machine. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the VirtualMachineImageResourceInner object itself. + */ + public VirtualMachineImageResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: The supported Azure location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The supported Azure location of the resource. + * + * @param location the location value to set. + * @return the VirtualMachineImageResourceInner object itself. + */ + public VirtualMachineImageResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Specifies the tags that are assigned to the virtual machine. For more information about + * using tags, see [Using tags to organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Specifies the tags that are assigned to the virtual machine. For more information about + * using tags, see [Using tags to organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + * + * @param tags the tags value to set. + * @return the VirtualMachineImageResourceInner object itself. + */ + public VirtualMachineImageResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Virtual Machine. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineImageResourceInner object itself. + */ + public VirtualMachineImageResourceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineImageResourceInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineImageResourceInner")); + } + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model VirtualMachineImageResourceInner")); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java new file mode 100644 index 0000000000000..19a3c36ff88cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java @@ -0,0 +1,978 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine. */ +@JsonFlatten +@Fluent +public class VirtualMachineInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInner.class); + + /* + * Specifies information about the marketplace image used to create the + * virtual machine. This element is only used for marketplace images. + * Before you can use a marketplace image from an API, you must enable the + * image for programmatic use. In the Azure portal, find the marketplace + * image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The virtual machine child extension resources. + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; + + /* + * The identity of the virtual machine, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineIdentity identity; + + /* + * The virtual machine zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The extended location of the Virtual Machine. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "properties.hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /* + * Specifies additional capabilities enabled or disabled on the virtual + * machine. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the operating system settings used while creating the virtual + * machine. Some of the settings cannot be changed once VM is provisioned. + */ + @JsonProperty(value = "properties.osProfile") + private OSProfile osProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + @JsonProperty(value = "properties.securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state.

Minimum + * api-version: 2015-06-15. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same + * availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see + * [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + *

For more information on Azure planned maintenance, see + * [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + *

Currently, a VM can only be added to availability set at + * creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set + * resource. An existing VM cannot be added to an availability set. + *

This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + */ + @JsonProperty(value = "properties.availabilitySet") + private SubResource availabilitySet; + + /* + * Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the + * same virtual machine scale set are allocated to different nodes to + * maximize availability. Currently, a VM can only be added to virtual + * machine scale set at creation time. An existing VM cannot be added to a + * virtual machine scale set.

This property cannot exist along with + * a non-null properties.availabilitySet reference.

Minimum + * api‐version: 2019‐03‐01 + */ + @JsonProperty(value = "properties.virtualMachineScaleSet") + private SubResource virtualMachineScaleSet; + + /* + * Specifies information about the proximity placement group that the + * virtual machine should be assigned to.

Minimum api-version: + * 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * Specifies the priority for the virtual machine.

Minimum + * api-version: 2019-03-01 + */ + @JsonProperty(value = "properties.priority") + private VirtualMachinePriorityTypes priority; + + /* + * Specifies the eviction policy for the Azure Spot virtual machine and + * Azure Spot scale set.

For Azure Spot virtual machines, both + * 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview. + */ + @JsonProperty(value = "properties.evictionPolicy") + private VirtualMachineEvictionPolicyTypes evictionPolicy; + + /* + * Specifies the billing related details of a Azure Spot virtual machine. + *

Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "properties.billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies information about the dedicated host that the virtual machine + * resides in.

Minimum api-version: 2018-10-01. + */ + @JsonProperty(value = "properties.host") + private SubResource host; + + /* + * Specifies information about the dedicated host group that the virtual + * machine resides in.

Minimum api-version: 2020-06-01. + *

NOTE: User cannot specify both host and hostGroup properties. + */ + @JsonProperty(value = "properties.hostGroup") + private SubResource hostGroup; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineInstanceViewInner instanceView; + + /* + * Specifies that the image or disk that is being used was licensed + * on-premises.

Possible values for Windows Server operating + * system are:

Windows_Client

Windows_Server

+ * Possible values for Linux Server operating system are:

+ * RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + *

[Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + *

Minimum api-version: 2015-06-15 + */ + @JsonProperty(value = "properties.licenseType") + private String licenseType; + + /* + * Specifies the VM unique ID which is a 128-bits identifier that is + * encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + * platform BIOS commands. + */ + @JsonProperty(value = "properties.vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * Specifies the time alloted for all extensions to start. The time + * duration should be between 15 minutes and 120 minutes (inclusive) and + * should be specified in ISO 8601 format. The default value is 90 minutes + * (PT1H30M).

Minimum api-version: 2020-06-01 + */ + @JsonProperty(value = "properties.extensionsTimeBudget") + private String extensionsTimeBudget; + + /* + * Specifies the scale set logical fault domain into which the Virtual + * Machine will be created. By default, the Virtual Machine will by + * automatically assigned to a fault domain that best maintains balance + * across available fault domains.
  • This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.
  • The + * Virtual Machine Scale Set that is referenced, must have + * 'platformFaultDomainCount' > 1.
  • This property cannot be updated + * once the Virtual Machine is created.
  • Fault domain assignment can be + * viewed in the Virtual Machine Instance View.

    Minimum api‐version: + * 2020‐12‐01 + */ + @JsonProperty(value = "properties.platformFaultDomain") + private Integer platformFaultDomain; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "properties.scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here.

    Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "properties.userData") + private String userData; + + /* + * Specifies information about the capacity reservation that is used to + * allocate virtual machine.

    Minimum api-version: 2021-04-01. + */ + @JsonProperty(value = "properties.capacityReservation") + private CapacityReservationProfile capacityReservation; + + /** + * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @param plan the plan value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the resources property: The virtual machine child extension resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Get the identity property: The identity of the virtual machine, if configured. + * + * @return the identity value. + */ + public VirtualMachineIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the virtual machine, if configured. + * + * @param identity the identity value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withIdentity(VirtualMachineIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the zones property: The virtual machine zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The virtual machine zones. + * + * @param zones the zones value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Virtual Machine. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some + * of the settings cannot be changed once VM is provisioned. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some + * of the settings cannot be changed once VM is provisioned. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withAvailabilitySet(SubResource availabilitySet) { + this.availabilitySet = availabilitySet; + return this; + } + + /** + * Get the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + public SubResource virtualMachineScaleSet() { + return this.virtualMachineScaleSet; + } + + /** + * Set the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + this.virtualMachineScaleSet = virtualMachineScaleSet; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.priority; + } + + /** + * Set the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @param priority the priority value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPriority(VirtualMachinePriorityTypes priority) { + this.priority = priority; + return this; + } + + /** + * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.billingProfile; + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + public SubResource host() { + return this.host; + } + + /** + * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @param host the host value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withHost(SubResource host) { + this.host = host; + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host + * and hostGroup properties. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.hostGroup; + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host + * and hostGroup properties. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withHostGroup(SubResource hostGroup) { + this.hostGroup = hostGroup; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceViewInner instanceView() { + return this.instanceView; + } + + /** + * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in + * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.extensionsTimeBudget; + } + + /** + * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withExtensionsTimeBudget(String extensionsTimeBudget) { + this.extensionsTimeBudget = extensionsTimeBudget; + return this; + } + + /** + * Get the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best + * maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best + * maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plan() != null) { + plan().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstallPatchesResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstallPatchesResultInner.java new file mode 100644 index 0000000000000..42e5443fc59dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstallPatchesResultInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.PatchInstallationDetail; +import com.azure.resourcemanager.compute.generated.models.PatchOperationStatus; +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchRebootStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The result summary of an installation operation. */ +@Immutable +public final class VirtualMachineInstallPatchesResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInstallPatchesResultInner.class); + + /* + * The overall success or failure status of the operation. It remains + * "InProgress" until the operation completes. At that point it will become + * "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + */ + @JsonProperty(value = "installationActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String installationActivityId; + + /* + * The reboot state of the VM following completion of the operation. + */ + @JsonProperty(value = "rebootStatus", access = JsonProperty.Access.WRITE_ONLY) + private VMGuestPatchRebootStatus rebootStatus; + + /* + * Whether the operation ran out of time before it completed all its + * intended actions. + */ + @JsonProperty(value = "maintenanceWindowExceeded", access = JsonProperty.Access.WRITE_ONLY) + private Boolean maintenanceWindowExceeded; + + /* + * The number of patches that were not installed due to the user blocking + * their installation. + */ + @JsonProperty(value = "excludedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer excludedPatchCount; + + /* + * The number of patches that were detected as available for install, but + * did not meet the operation's criteria. + */ + @JsonProperty(value = "notSelectedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer notSelectedPatchCount; + + /* + * The number of patches that were identified as meeting the installation + * criteria, but were not able to be installed. Typically this happens when + * maintenanceWindowExceeded == true. + */ + @JsonProperty(value = "pendingPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer pendingPatchCount; + + /* + * The number of patches successfully installed. + */ + @JsonProperty(value = "installedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer installedPatchCount; + + /* + * The number of patches that could not be installed due to some issue. See + * errors for details. + */ + @JsonProperty(value = "failedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedPatchCount; + + /* + * The patches that were installed during the operation. + */ + @JsonProperty(value = "patches", access = JsonProperty.Access.WRITE_ONLY) + private List patches; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /* + * The errors that were encountered during execution of the operation. The + * details array contains the list of them. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the installationActivityId property: The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + * + * @return the installationActivityId value. + */ + public String installationActivityId() { + return this.installationActivityId; + } + + /** + * Get the rebootStatus property: The reboot state of the VM following completion of the operation. + * + * @return the rebootStatus value. + */ + public VMGuestPatchRebootStatus rebootStatus() { + return this.rebootStatus; + } + + /** + * Get the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its + * intended actions. + * + * @return the maintenanceWindowExceeded value. + */ + public Boolean maintenanceWindowExceeded() { + return this.maintenanceWindowExceeded; + } + + /** + * Get the excludedPatchCount property: The number of patches that were not installed due to the user blocking their + * installation. + * + * @return the excludedPatchCount value. + */ + public Integer excludedPatchCount() { + return this.excludedPatchCount; + } + + /** + * Get the notSelectedPatchCount property: The number of patches that were detected as available for install, but + * did not meet the operation's criteria. + * + * @return the notSelectedPatchCount value. + */ + public Integer notSelectedPatchCount() { + return this.notSelectedPatchCount; + } + + /** + * Get the pendingPatchCount property: The number of patches that were identified as meeting the installation + * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + * + * @return the pendingPatchCount value. + */ + public Integer pendingPatchCount() { + return this.pendingPatchCount; + } + + /** + * Get the installedPatchCount property: The number of patches successfully installed. + * + * @return the installedPatchCount value. + */ + public Integer installedPatchCount() { + return this.installedPatchCount; + } + + /** + * Get the failedPatchCount property: The number of patches that could not be installed due to some issue. See + * errors for details. + * + * @return the failedPatchCount value. + */ + public Integer failedPatchCount() { + return this.failedPatchCount; + } + + /** + * Get the patches property: The patches that were installed during the operation. + * + * @return the patches value. + */ + public List patches() { + return this.patches; + } + + /** + * Get the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Get the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (patches() != null) { + patches().forEach(e -> e.validate()); + } + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstanceViewInner.java new file mode 100644 index 0000000000000..30ea8b1a98403 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInstanceViewInner.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.BootDiagnosticsInstanceView; +import com.azure.resourcemanager.compute.generated.models.DiskInstanceView; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationType; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.MaintenanceRedeployStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAgentInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineHealthStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePatchStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine. */ +@Fluent +public final class VirtualMachineInstanceViewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInstanceViewInner.class); + + /* + * Specifies the update domain of the virtual machine. + */ + @JsonProperty(value = "platformUpdateDomain") + private Integer platformUpdateDomain; + + /* + * Specifies the fault domain of the virtual machine. + */ + @JsonProperty(value = "platformFaultDomain") + private Integer platformFaultDomain; + + /* + * The computer name assigned to the virtual machine. + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * The Operating System running on the virtual machine. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The version of Operating System running on the virtual machine. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * Specifies the HyperVGeneration Type associated with a resource + */ + @JsonProperty(value = "hyperVGeneration") + private HyperVGenerationType hyperVGeneration; + + /* + * The Remote desktop certificate thumbprint. + */ + @JsonProperty(value = "rdpThumbPrint") + private String rdpThumbPrint; + + /* + * The VM Agent running on the virtual machine. + */ + @JsonProperty(value = "vmAgent") + private VirtualMachineAgentInstanceView vmAgent; + + /* + * The Maintenance Operation status on the virtual machine. + */ + @JsonProperty(value = "maintenanceRedeployStatus") + private MaintenanceRedeployStatus maintenanceRedeployStatus; + + /* + * The virtual machine disk information. + */ + @JsonProperty(value = "disks") + private List disks; + + /* + * The extensions information. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * The health status for the VM. + */ + @JsonProperty(value = "vmHealth", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineHealthStatus vmHealth; + + /* + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    You can easily + * view the output of your console log.

    Azure also enables you to + * see a screenshot of the VM from the hypervisor. + */ + @JsonProperty(value = "bootDiagnostics") + private BootDiagnosticsInstanceView bootDiagnostics; + + /* + * Resource id of the dedicated host, on which the virtual machine is + * allocated through automatic placement, when the virtual machine is + * associated with a dedicated host group that has automatic placement + * enabled.

    Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "assignedHost", access = JsonProperty.Access.WRITE_ONLY) + private String assignedHost; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /* + * [Preview Feature] The status of virtual machine patch operations. + */ + @JsonProperty(value = "patchStatus") + private VirtualMachinePatchStatus patchStatus; + + /** + * Get the platformUpdateDomain property: Specifies the update domain of the virtual machine. + * + * @return the platformUpdateDomain value. + */ + public Integer platformUpdateDomain() { + return this.platformUpdateDomain; + } + + /** + * Set the platformUpdateDomain property: Specifies the update domain of the virtual machine. + * + * @param platformUpdateDomain the platformUpdateDomain value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withPlatformUpdateDomain(Integer platformUpdateDomain) { + this.platformUpdateDomain = platformUpdateDomain; + return this; + } + + /** + * Get the platformFaultDomain property: Specifies the fault domain of the virtual machine. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: Specifies the fault domain of the virtual machine. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the computerName property: The computer name assigned to the virtual machine. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: The computer name assigned to the virtual machine. + * + * @param computerName the computerName value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the osName property: The Operating System running on the virtual machine. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The Operating System running on the virtual machine. + * + * @param osName the osName value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the osVersion property: The version of Operating System running on the virtual machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: The version of Operating System running on the virtual machine. + * + * @param osVersion the osVersion value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGeneration Type associated with a resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationType hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGeneration Type associated with a resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withHyperVGeneration(HyperVGenerationType hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @return the rdpThumbPrint value. + */ + public String rdpThumbPrint() { + return this.rdpThumbPrint; + } + + /** + * Set the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @param rdpThumbPrint the rdpThumbPrint value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withRdpThumbPrint(String rdpThumbPrint) { + this.rdpThumbPrint = rdpThumbPrint; + return this; + } + + /** + * Get the vmAgent property: The VM Agent running on the virtual machine. + * + * @return the vmAgent value. + */ + public VirtualMachineAgentInstanceView vmAgent() { + return this.vmAgent; + } + + /** + * Set the vmAgent property: The VM Agent running on the virtual machine. + * + * @param vmAgent the vmAgent value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withVmAgent(VirtualMachineAgentInstanceView vmAgent) { + this.vmAgent = vmAgent; + return this; + } + + /** + * Get the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @return the maintenanceRedeployStatus value. + */ + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.maintenanceRedeployStatus; + } + + /** + * Set the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withMaintenanceRedeployStatus( + MaintenanceRedeployStatus maintenanceRedeployStatus) { + this.maintenanceRedeployStatus = maintenanceRedeployStatus; + return this; + } + + /** + * Get the disks property: The virtual machine disk information. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: The virtual machine disk information. + * + * @param disks the disks value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the extensions property: The extensions information. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The extensions information. + * + * @param extensions the extensions value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the vmHealth property: The health status for the VM. + * + * @return the vmHealth value. + */ + public VirtualMachineHealthStatus vmHealth() { + return this.vmHealth; + } + + /** + * Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + public BootDiagnosticsInstanceView bootDiagnostics() { + return this.bootDiagnostics; + } + + /** + * Set the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @param bootDiagnostics the bootDiagnostics value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { + this.bootDiagnostics = bootDiagnostics; + return this; + } + + /** + * Get the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated + * through automatic placement, when the virtual machine is associated with a dedicated host group that has + * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. + * + * @return the assignedHost value. + */ + public String assignedHost() { + return this.assignedHost; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Get the patchStatus property: [Preview Feature] The status of virtual machine patch operations. + * + * @return the patchStatus value. + */ + public VirtualMachinePatchStatus patchStatus() { + return this.patchStatus; + } + + /** + * Set the patchStatus property: [Preview Feature] The status of virtual machine patch operations. + * + * @param patchStatus the patchStatus value to set. + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withPatchStatus(VirtualMachinePatchStatus patchStatus) { + this.patchStatus = patchStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmAgent() != null) { + vmAgent().validate(); + } + if (maintenanceRedeployStatus() != null) { + maintenanceRedeployStatus().validate(); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (vmHealth() != null) { + vmHealth().validate(); + } + if (bootDiagnostics() != null) { + bootDiagnostics().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + if (patchStatus() != null) { + patchStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandInner.java new file mode 100644 index 0000000000000..b4dace42b0ea5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineRunCommandInner.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine run command. */ +@JsonFlatten +@Fluent +public class VirtualMachineRunCommandInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandInner.class); + + /* + * The source of the run command script. + */ + @JsonProperty(value = "properties.source") + private VirtualMachineRunCommandScriptSource source; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "properties.protectedParameters") + private List protectedParameters; + + /* + * Optional. If set to true, provisioning will complete as soon as the + * script starts and will not wait for script to complete. + */ + @JsonProperty(value = "properties.asyncExecution") + private Boolean asyncExecution; + + /* + * Specifies the user account on the VM when executing the run command. + */ + @JsonProperty(value = "properties.runAsUser") + private String runAsUser; + + /* + * Specifies the user account password on the VM when executing the run + * command. + */ + @JsonProperty(value = "properties.runAsPassword") + private String runAsPassword; + + /* + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "properties.timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Specifies the Azure storage blob where script output stream will be + * uploaded. + */ + @JsonProperty(value = "properties.outputBlobUri") + private String outputBlobUri; + + /* + * Specifies the Azure storage blob where script error stream will be + * uploaded. + */ + @JsonProperty(value = "properties.errorBlobUri") + private String errorBlobUri; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine run command instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineRunCommandInstanceView instanceView; + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public VirtualMachineRunCommandScriptSource source() { + return this.source; + } + + /** + * Set the source property: The source of the run command script. + * + * @param source the source value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withSource(VirtualMachineRunCommandScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters used by the script. + * + * @param parameters the parameters value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.protectedParameters; + } + + /** + * Set the protectedParameters property: The parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withProtectedParameters(List protectedParameters) { + this.protectedParameters = protectedParameters; + return this; + } + + /** + * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script + * starts and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + public Boolean asyncExecution() { + return this.asyncExecution; + } + + /** + * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script + * starts and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withAsyncExecution(Boolean asyncExecution) { + this.asyncExecution = asyncExecution; + return this; + } + + /** + * Get the runAsUser property: Specifies the user account on the VM when executing the run command. + * + * @return the runAsUser value. + */ + public String runAsUser() { + return this.runAsUser; + } + + /** + * Set the runAsUser property: Specifies the user account on the VM when executing the run command. + * + * @param runAsUser the runAsUser value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withRunAsUser(String runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get the runAsPassword property: Specifies the user account password on the VM when executing the run command. + * + * @return the runAsPassword value. + */ + public String runAsPassword() { + return this.runAsPassword; + } + + /** + * Set the runAsPassword property: Specifies the user account password on the VM when executing the run command. + * + * @param runAsPassword the runAsPassword value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withRunAsPassword(String runAsPassword) { + this.runAsPassword = runAsPassword; + return this; + } + + /** + * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.outputBlobUri; + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.errorBlobUri; + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine run command instance view. + * + * @return the instanceView value. + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (protectedParameters() != null) { + protectedParameters().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionInner.java new file mode 100644 index 0000000000000..ec0a762f12934 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetExtensionInner.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionInner.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * If a value is provided and is different from the previous value, the + * extension handler will be forced to update even if the extension + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Collection of extension names after which this extension needs to be + * provisioned. + */ + @JsonProperty(value = "properties.provisionAfterExtensions") + private List provisionAfterExtensions; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineScaleSetExtensionInner object itself. + */ + public VirtualMachineScaleSetExtensionInner withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java new file mode 100644 index 0000000000000..78808fdcbdcec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java @@ -0,0 +1,662 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Scale Set. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInner.class); + + /* + * The virtual machine scale set sku. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Specifies information about the marketplace image used to create the + * virtual machine. This element is only used for marketplace images. + * Before you can use a marketplace image from an API, you must enable the + * image for programmatic use. In the Azure portal, find the marketplace + * image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The identity of the virtual machine scale set, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineScaleSetIdentity identity; + + /* + * The virtual machine scale set zones. NOTE: Availability zones can only + * be set when you create the scale set + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The extended location of the Virtual Machine Scale Set. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The upgrade policy. + */ + @JsonProperty(value = "properties.upgradePolicy") + private UpgradePolicy upgradePolicy; + + /* + * Policy for automatic repairs. + */ + @JsonProperty(value = "properties.automaticRepairsPolicy") + private AutomaticRepairsPolicy automaticRepairsPolicy; + + /* + * The virtual machine profile. + */ + @JsonProperty(value = "properties.virtualMachineProfile") + private VirtualMachineScaleSetVMProfile virtualMachineProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies whether the Virtual Machine Scale Set should be + * overprovisioned. + */ + @JsonProperty(value = "properties.overprovision") + private Boolean overprovision; + + /* + * When Overprovision is enabled, extensions are launched only on the + * requested number of VMs which are finally kept. This property will hence + * ensure that the extensions do not run on the extra overprovisioned VMs. + */ + @JsonProperty(value = "properties.doNotRunExtensionsOnOverprovisionedVMs") + private Boolean doNotRunExtensionsOnOverprovisionedVMs; + + /* + * Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + */ + @JsonProperty(value = "properties.uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /* + * When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may + * be modified to false. However, if singlePlacementGroup is false, it may + * not be modified to true. + */ + @JsonProperty(value = "properties.singlePlacementGroup") + private Boolean singlePlacementGroup; + + /* + * Whether to force strictly even Virtual Machine distribution cross + * x-zones in case there is zone outage. + */ + @JsonProperty(value = "properties.zoneBalance") + private Boolean zoneBalance; + + /* + * Fault Domain count for each placement group. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to.

    Minimum + * api-version: 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * Specifies information about the dedicated host group that the virtual + * machine scale set resides in.

    Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "properties.hostGroup") + private SubResource hostGroup; + + /* + * Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the + * Virtual Machines have the capability to support attaching managed data + * disks with UltraSSD_LRS storage account type. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the scale-in policy that decides which virtual machines are + * chosen for removal when a Virtual Machine Scale Set is scaled-in. + */ + @JsonProperty(value = "properties.scaleInPolicy") + private ScaleInPolicy scaleInPolicy; + + /* + * Specifies the orchestration mode for the virtual machine scale set. + */ + @JsonProperty(value = "properties.orchestrationMode") + private OrchestrationMode orchestrationMode; + + /* + * Specifies the Spot Restore properties for the virtual machine scale set. + */ + @JsonProperty(value = "properties.spotRestorePolicy") + private SpotRestorePolicy spotRestorePolicy; + + /** + * Get the sku property: The virtual machine scale set sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The virtual machine scale set sku. + * + * @param sku the sku value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @param plan the plan value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the identity property: The identity of the virtual machine scale set, if configured. + * + * @return the identity value. + */ + public VirtualMachineScaleSetIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the virtual machine scale set, if configured. + * + * @param identity the identity value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withIdentity(VirtualMachineScaleSetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be set when you + * create the scale set. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be set when you + * create the scale set. + * + * @param zones the zones value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the extendedLocation property: The extended location of the Virtual Machine Scale Set. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Virtual Machine Scale Set. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: The upgrade policy. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withUpgradePolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @return the automaticRepairsPolicy value. + */ + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.automaticRepairsPolicy; + } + + /** + * Set the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { + this.automaticRepairsPolicy = automaticRepairsPolicy; + return this; + } + + /** + * Get the virtualMachineProfile property: The virtual machine profile. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineScaleSetVMProfile virtualMachineProfile() { + return this.virtualMachineProfile; + } + + /** + * Set the virtualMachineProfile property: The virtual machine profile. + * + * @param virtualMachineProfile the virtualMachineProfile value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withVirtualMachineProfile( + VirtualMachineScaleSetVMProfile virtualMachineProfile) { + this.virtualMachineProfile = virtualMachineProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @return the overprovision value. + */ + public Boolean overprovision() { + return this.overprovision; + } + + /** + * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @param overprovision the overprovision value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withOverprovision(Boolean overprovision) { + this.overprovision = overprovision; + return this; + } + + /** + * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched + * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions + * do not run on the extra overprovisioned VMs. + * + * @return the doNotRunExtensionsOnOverprovisionedVMs value. + */ + public Boolean doNotRunExtensionsOnOverprovisionedVMs() { + return this.doNotRunExtensionsOnOverprovisionedVMs; + } + + /** + * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched + * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions + * do not run on the extra overprovisioned VMs. + * + * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withDoNotRunExtensionsOnOverprovisionedVMs( + Boolean doNotRunExtensionsOnOverprovisionedVMs) { + this.doNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + return this; + } + + /** + * Get the uniqueId property: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * + * @return the singlePlacementGroup value. + */ + public Boolean singlePlacementGroup() { + return this.singlePlacementGroup; + } + + /** + * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * + * @param singlePlacementGroup the singlePlacementGroup value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withSinglePlacementGroup(Boolean singlePlacementGroup) { + this.singlePlacementGroup = singlePlacementGroup; + return this; + } + + /** + * Get the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. + * + * @return the zoneBalance value. + */ + public Boolean zoneBalance() { + return this.zoneBalance; + } + + /** + * Set the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. + * + * @param zoneBalance the zoneBalance value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withZoneBalance(Boolean zoneBalance) { + this.zoneBalance = zoneBalance; + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count for each placement group. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Fault Domain count for each placement group. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale + * set resides in. <br><br>Minimum api-version: 2020-06-01. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.hostGroup; + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale + * set resides in. <br><br>Minimum api-version: 2020-06-01. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withHostGroup(SubResource hostGroup) { + this.hostGroup = hostGroup; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.scaleInPolicy; + } + + /** + * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + this.scaleInPolicy = scaleInPolicy; + return this; + } + + /** + * Get the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale set. + * + * @return the orchestrationMode value. + */ + public OrchestrationMode orchestrationMode() { + return this.orchestrationMode; + } + + /** + * Set the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale set. + * + * @param orchestrationMode the orchestrationMode value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withOrchestrationMode(OrchestrationMode orchestrationMode) { + this.orchestrationMode = orchestrationMode; + return this; + } + + /** + * Get the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + public SpotRestorePolicy spotRestorePolicy() { + return this.spotRestorePolicy; + } + + /** + * Set the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @param spotRestorePolicy the spotRestorePolicy value to set. + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + this.spotRestorePolicy = spotRestorePolicy; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } + if (automaticRepairsPolicy() != null) { + automaticRepairsPolicy().validate(); + } + if (virtualMachineProfile() != null) { + virtualMachineProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (scaleInPolicy() != null) { + scaleInPolicy().validate(); + } + if (spotRestorePolicy() != null) { + spotRestorePolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInstanceViewInner.java new file mode 100644 index 0000000000000..08f4f08733b87 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInstanceViewInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceSummary; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetInstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionsSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine scale set. */ +@Fluent +public final class VirtualMachineScaleSetInstanceViewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInstanceViewInner.class); + + /* + * The instance view status summary for the virtual machine scale set. + */ + @JsonProperty(value = "virtualMachine", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine; + + /* + * The extensions information. + */ + @JsonProperty(value = "extensions", access = JsonProperty.Access.WRITE_ONLY) + private List extensions; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /* + * The orchestration services information. + */ + @JsonProperty(value = "orchestrationServices", access = JsonProperty.Access.WRITE_ONLY) + private List orchestrationServices; + + /** + * Get the virtualMachine property: The instance view status summary for the virtual machine scale set. + * + * @return the virtualMachine value. + */ + public VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine() { + return this.virtualMachine; + } + + /** + * Get the extensions property: The extensions information. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineScaleSetInstanceViewInner object itself. + */ + public VirtualMachineScaleSetInstanceViewInner withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Get the orchestrationServices property: The orchestration services information. + * + * @return the orchestrationServices value. + */ + public List orchestrationServices() { + return this.orchestrationServices; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachine() != null) { + virtualMachine().validate(); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + if (orchestrationServices() != null) { + orchestrationServices().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetSkuInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetSkuInner.java new file mode 100644 index 0000000000000..e83f1b3463f9c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetSkuInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSkuCapacity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an available virtual machine scale set sku. */ +@Immutable +public final class VirtualMachineScaleSetSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetSkuInner.class); + + /* + * The type of resource the sku applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The Sku. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * Specifies the number of virtual machines in the scale set. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineScaleSetSkuCapacity capacity; + + /** + * Get the resourceType property: The type of resource the sku applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the sku property: The Sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + public VirtualMachineScaleSetSkuCapacity capacity() { + return this.capacity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (capacity() != null) { + capacity().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionInner.java new file mode 100644 index 0000000000000..98eeb274e09e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionInner.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a VMSS VM Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetVMExtensionInner extends SubResourceReadOnly { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionInner.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine extension instance view. + */ + @JsonProperty(value = "properties.instanceView") + private VirtualMachineExtensionInstanceView instanceView; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the instanceView property: The virtual machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java new file mode 100644 index 0000000000000..b8aa3e3eedbd1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMExtensionsListResultInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List VMSS VM Extension operation response. */ +@Fluent +public final class VirtualMachineScaleSetVMExtensionsListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsListResultInner.class); + + /* + * The list of VMSS VM extensions + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of VMSS VM extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VMSS VM extensions. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetVMExtensionsListResultInner object itself. + */ + public VirtualMachineScaleSetVMExtensionsListResultInner withValue( + List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java new file mode 100644 index 0000000000000..223f7f4e7b764 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a virtual machine scale set virtual machine. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetVMInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInner.class); + + /* + * The virtual machine instance ID. + */ + @JsonProperty(value = "instanceId", access = JsonProperty.Access.WRITE_ONLY) + private String instanceId; + + /* + * The virtual machine SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * Specifies information about the marketplace image used to create the + * virtual machine. This element is only used for marketplace images. + * Before you can use a marketplace image from an API, you must enable the + * image for programmatic use. In the Azure portal, find the marketplace + * image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The virtual machine child extension resources. + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; + + /* + * The virtual machine zones. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /* + * Specifies whether the latest model has been applied to the virtual + * machine. + */ + @JsonProperty(value = "properties.latestModelApplied", access = JsonProperty.Access.WRITE_ONLY) + private Boolean latestModelApplied; + + /* + * Azure VM unique ID. + */ + @JsonProperty(value = "properties.vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineScaleSetVMInstanceViewInner instanceView; + + /* + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "properties.hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /* + * Specifies additional capabilities enabled or disabled on the virtual + * machine in the scale set. For instance: whether the virtual machine has + * the capability to support attaching managed data disks with UltraSSD_LRS + * storage account type. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the operating system settings for the virtual machine. + */ + @JsonProperty(value = "properties.osProfile") + private OSProfile osProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + @JsonProperty(value = "properties.securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /* + * Specifies the network profile configuration of the virtual machine. + */ + @JsonProperty(value = "properties.networkProfileConfiguration") + private VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration; + + /* + * Specifies the boot diagnostic settings state.

    Minimum + * api-version: 2015-06-15. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same + * availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see + * [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + *

    For more information on Azure planned maintenance, see + * [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + *

    Currently, a VM can only be added to availability set at + * creation time. An existing VM cannot be added to an availability set. + */ + @JsonProperty(value = "properties.availabilitySet") + private SubResource availabilitySet; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies that the image or disk that is being used was licensed + * on-premises.

    Possible values for Windows Server operating + * system are:

    Windows_Client

    Windows_Server

    + * Possible values for Linux Server operating system are:

    + * RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + *

    [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + *

    Minimum api-version: 2015-06-15 + */ + @JsonProperty(value = "properties.licenseType") + private String licenseType; + + /* + * Specifies whether the model applied to the virtual machine is the model + * of the virtual machine scale set or the customized model for the virtual + * machine. + */ + @JsonProperty(value = "properties.modelDefinitionApplied", access = JsonProperty.Access.WRITE_ONLY) + private String modelDefinitionApplied; + + /* + * Specifies the protection policy of the virtual machine. + */ + @JsonProperty(value = "properties.protectionPolicy") + private VirtualMachineScaleSetVMProtectionPolicy protectionPolicy; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here.

    Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "properties.userData") + private String userData; + + /** + * Get the instanceId property: The virtual machine instance ID. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Get the sku property: The virtual machine SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @param plan the plan value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the resources property: The virtual machine child extension resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Get the zones property: The virtual machine zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the latestModelApplied property: Specifies whether the latest model has been applied to the virtual machine. + * + * @return the latestModelApplied value. + */ + public Boolean latestModelApplied() { + return this.latestModelApplied; + } + + /** + * Get the vmId property: Azure VM unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineScaleSetVMInstanceViewInner instanceView() { + return this.instanceView; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching + * managed data disks with UltraSSD_LRS storage account type. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching + * managed data disks with UltraSSD_LRS storage account type. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the virtual machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the virtual machine. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. + * + * @return the networkProfileConfiguration value. + */ + public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { + return this.networkProfileConfiguration; + } + + /** + * Set the networkProfileConfiguration property: Specifies the network profile configuration of the virtual machine. + * + * @param networkProfileConfiguration the networkProfileConfiguration value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withNetworkProfileConfiguration( + VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration) { + this.networkProfileConfiguration = networkProfileConfiguration; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability + * set. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability + * set. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withAvailabilitySet(SubResource availabilitySet) { + this.availabilitySet = availabilitySet; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model + * of the virtual machine scale set or the customized model for the virtual machine. + * + * @return the modelDefinitionApplied value. + */ + public String modelDefinitionApplied() { + return this.modelDefinitionApplied; + } + + /** + * Get the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @return the protectionPolicy value. + */ + public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { + return this.protectionPolicy; + } + + /** + * Set the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @param protectionPolicy the protectionPolicy value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withProtectionPolicy( + VirtualMachineScaleSetVMProtectionPolicy protectionPolicy) { + this.protectionPolicy = protectionPolicy; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMInner object itself. + */ + public VirtualMachineScaleSetVMInner withUserData(String userData) { + this.userData = userData; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (networkProfileConfiguration() != null) { + networkProfileConfiguration().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (protectionPolicy() != null) { + protectionPolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java new file mode 100644 index 0000000000000..f3d4035189a37 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInstanceViewInner.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.BootDiagnosticsInstanceView; +import com.azure.resourcemanager.compute.generated.models.DiskInstanceView; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.MaintenanceRedeployStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAgentInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineHealthStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine scale set VM. */ +@Fluent +public final class VirtualMachineScaleSetVMInstanceViewInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceViewInner.class); + + /* + * The Update Domain count. + */ + @JsonProperty(value = "platformUpdateDomain") + private Integer platformUpdateDomain; + + /* + * The Fault Domain count. + */ + @JsonProperty(value = "platformFaultDomain") + private Integer platformFaultDomain; + + /* + * The Remote desktop certificate thumbprint. + */ + @JsonProperty(value = "rdpThumbPrint") + private String rdpThumbPrint; + + /* + * The VM Agent running on the virtual machine. + */ + @JsonProperty(value = "vmAgent") + private VirtualMachineAgentInstanceView vmAgent; + + /* + * The Maintenance Operation status on the virtual machine. + */ + @JsonProperty(value = "maintenanceRedeployStatus") + private MaintenanceRedeployStatus maintenanceRedeployStatus; + + /* + * The disks information. + */ + @JsonProperty(value = "disks") + private List disks; + + /* + * The extensions information. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * The health status for the VM. + */ + @JsonProperty(value = "vmHealth", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineHealthStatus vmHealth; + + /* + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    You can easily + * view the output of your console log.

    Azure also enables you to + * see a screenshot of the VM from the hypervisor. + */ + @JsonProperty(value = "bootDiagnostics") + private BootDiagnosticsInstanceView bootDiagnostics; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /* + * Resource id of the dedicated host, on which the virtual machine is + * allocated through automatic placement, when the virtual machine is + * associated with a dedicated host group that has automatic placement + * enabled.

    Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "assignedHost", access = JsonProperty.Access.WRITE_ONLY) + private String assignedHost; + + /* + * The placement group in which the VM is running. If the VM is deallocated + * it will not have a placementGroupId. + */ + @JsonProperty(value = "placementGroupId") + private String placementGroupId; + + /** + * Get the platformUpdateDomain property: The Update Domain count. + * + * @return the platformUpdateDomain value. + */ + public Integer platformUpdateDomain() { + return this.platformUpdateDomain; + } + + /** + * Set the platformUpdateDomain property: The Update Domain count. + * + * @param platformUpdateDomain the platformUpdateDomain value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withPlatformUpdateDomain(Integer platformUpdateDomain) { + this.platformUpdateDomain = platformUpdateDomain; + return this; + } + + /** + * Get the platformFaultDomain property: The Fault Domain count. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: The Fault Domain count. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @return the rdpThumbPrint value. + */ + public String rdpThumbPrint() { + return this.rdpThumbPrint; + } + + /** + * Set the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @param rdpThumbPrint the rdpThumbPrint value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withRdpThumbPrint(String rdpThumbPrint) { + this.rdpThumbPrint = rdpThumbPrint; + return this; + } + + /** + * Get the vmAgent property: The VM Agent running on the virtual machine. + * + * @return the vmAgent value. + */ + public VirtualMachineAgentInstanceView vmAgent() { + return this.vmAgent; + } + + /** + * Set the vmAgent property: The VM Agent running on the virtual machine. + * + * @param vmAgent the vmAgent value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withVmAgent(VirtualMachineAgentInstanceView vmAgent) { + this.vmAgent = vmAgent; + return this; + } + + /** + * Get the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @return the maintenanceRedeployStatus value. + */ + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.maintenanceRedeployStatus; + } + + /** + * Set the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withMaintenanceRedeployStatus( + MaintenanceRedeployStatus maintenanceRedeployStatus) { + this.maintenanceRedeployStatus = maintenanceRedeployStatus; + return this; + } + + /** + * Get the disks property: The disks information. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: The disks information. + * + * @param disks the disks value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the extensions property: The extensions information. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The extensions information. + * + * @param extensions the extensions value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withExtensions( + List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the vmHealth property: The health status for the VM. + * + * @return the vmHealth value. + */ + public VirtualMachineHealthStatus vmHealth() { + return this.vmHealth; + } + + /** + * Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + public BootDiagnosticsInstanceView bootDiagnostics() { + return this.bootDiagnostics; + } + + /** + * Set the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @param bootDiagnostics the bootDiagnostics value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { + this.bootDiagnostics = bootDiagnostics; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Get the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated + * through automatic placement, when the virtual machine is associated with a dedicated host group that has + * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. + * + * @return the assignedHost value. + */ + public String assignedHost() { + return this.assignedHost; + } + + /** + * Get the placementGroupId property: The placement group in which the VM is running. If the VM is deallocated it + * will not have a placementGroupId. + * + * @return the placementGroupId value. + */ + public String placementGroupId() { + return this.placementGroupId; + } + + /** + * Set the placementGroupId property: The placement group in which the VM is running. If the VM is deallocated it + * will not have a placementGroupId. + * + * @param placementGroupId the placementGroupId value to set. + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withPlacementGroupId(String placementGroupId) { + this.placementGroupId = placementGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmAgent() != null) { + vmAgent().validate(); + } + if (maintenanceRedeployStatus() != null) { + maintenanceRedeployStatus().validate(); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + if (vmHealth() != null) { + vmHealth().validate(); + } + if (bootDiagnostics() != null) { + bootDiagnostics().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java new file mode 100644 index 0000000000000..5eb8e65f1e503 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a VM size. */ +@Fluent +public final class VirtualMachineSizeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSizeInner.class); + + /* + * The name of the virtual machine size. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The number of cores supported by the virtual machine size. For + * Constrained vCPU capable VM sizes, this number represents the total + * vCPUs of quota that the VM uses. For accurate vCPU count, please refer + * to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list + */ + @JsonProperty(value = "numberOfCores") + private Integer numberOfCores; + + /* + * The OS disk size, in MB, allowed by the virtual machine size. + */ + @JsonProperty(value = "osDiskSizeInMB") + private Integer osDiskSizeInMB; + + /* + * The resource disk size, in MB, allowed by the virtual machine size. + */ + @JsonProperty(value = "resourceDiskSizeInMB") + private Integer resourceDiskSizeInMB; + + /* + * The amount of memory, in MB, supported by the virtual machine size. + */ + @JsonProperty(value = "memoryInMB") + private Integer memoryInMB; + + /* + * The maximum number of data disks that can be attached to the virtual + * machine size. + */ + @JsonProperty(value = "maxDataDiskCount") + private Integer maxDataDiskCount; + + /** + * Get the name property: The name of the virtual machine size. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the virtual machine size. + * + * @param name the name value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @return the numberOfCores value. + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @param numberOfCores the numberOfCores value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withNumberOfCores(Integer numberOfCores) { + this.numberOfCores = numberOfCores; + return this; + } + + /** + * Get the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @return the osDiskSizeInMB value. + */ + public Integer osDiskSizeInMB() { + return this.osDiskSizeInMB; + } + + /** + * Set the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @param osDiskSizeInMB the osDiskSizeInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withOsDiskSizeInMB(Integer osDiskSizeInMB) { + this.osDiskSizeInMB = osDiskSizeInMB; + return this; + } + + /** + * Get the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @return the resourceDiskSizeInMB value. + */ + public Integer resourceDiskSizeInMB() { + return this.resourceDiskSizeInMB; + } + + /** + * Set the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @param resourceDiskSizeInMB the resourceDiskSizeInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withResourceDiskSizeInMB(Integer resourceDiskSizeInMB) { + this.resourceDiskSizeInMB = resourceDiskSizeInMB; + return this; + } + + /** + * Get the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @return the memoryInMB value. + */ + public Integer memoryInMB() { + return this.memoryInMB; + } + + /** + * Set the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @param memoryInMB the memoryInMB value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withMemoryInMB(Integer memoryInMB) { + this.memoryInMB = memoryInMB; + return this; + } + + /** + * Get the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @return the maxDataDiskCount value. + */ + public Integer maxDataDiskCount() { + return this.maxDataDiskCount; + } + + /** + * Set the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @param maxDataDiskCount the maxDataDiskCount value to set. + * @return the VirtualMachineSizeInner object itself. + */ + public VirtualMachineSizeInner withMaxDataDiskCount(Integer maxDataDiskCount) { + this.maxDataDiskCount = maxDataDiskCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java new file mode 100644 index 0000000000000..3f574fe9dfbb8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java @@ -0,0 +1,925 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.UpdateResource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine Update. */ +@JsonFlatten +@Fluent +public class VirtualMachineUpdateInner extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineUpdateInner.class); + + /* + * Specifies information about the marketplace image used to create the + * virtual machine. This element is only used for marketplace images. + * Before you can use a marketplace image from an API, you must enable the + * image for programmatic use. In the Azure portal, find the marketplace + * image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The identity of the virtual machine, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineIdentity identity; + + /* + * The virtual machine zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "properties.hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /* + * Specifies additional capabilities enabled or disabled on the virtual + * machine. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the operating system settings used while creating the virtual + * machine. Some of the settings cannot be changed once VM is provisioned. + */ + @JsonProperty(value = "properties.osProfile") + private OSProfile osProfile; + + /* + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machine. + */ + @JsonProperty(value = "properties.securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state.

    Minimum + * api-version: 2015-06-15. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same + * availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see + * [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + *

    For more information on Azure planned maintenance, see + * [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + *

    Currently, a VM can only be added to availability set at + * creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set + * resource. An existing VM cannot be added to an availability set. + *

    This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + */ + @JsonProperty(value = "properties.availabilitySet") + private SubResource availabilitySet; + + /* + * Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the + * same virtual machine scale set are allocated to different nodes to + * maximize availability. Currently, a VM can only be added to virtual + * machine scale set at creation time. An existing VM cannot be added to a + * virtual machine scale set.

    This property cannot exist along with + * a non-null properties.availabilitySet reference.

    Minimum + * api‐version: 2019‐03‐01 + */ + @JsonProperty(value = "properties.virtualMachineScaleSet") + private SubResource virtualMachineScaleSet; + + /* + * Specifies information about the proximity placement group that the + * virtual machine should be assigned to.

    Minimum api-version: + * 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * Specifies the priority for the virtual machine.

    Minimum + * api-version: 2019-03-01 + */ + @JsonProperty(value = "properties.priority") + private VirtualMachinePriorityTypes priority; + + /* + * Specifies the eviction policy for the Azure Spot virtual machine and + * Azure Spot scale set.

    For Azure Spot virtual machines, both + * 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview. + */ + @JsonProperty(value = "properties.evictionPolicy") + private VirtualMachineEvictionPolicyTypes evictionPolicy; + + /* + * Specifies the billing related details of a Azure Spot virtual machine. + *

    Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "properties.billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies information about the dedicated host that the virtual machine + * resides in.

    Minimum api-version: 2018-10-01. + */ + @JsonProperty(value = "properties.host") + private SubResource host; + + /* + * Specifies information about the dedicated host group that the virtual + * machine resides in.

    Minimum api-version: 2020-06-01. + *

    NOTE: User cannot specify both host and hostGroup properties. + */ + @JsonProperty(value = "properties.hostGroup") + private SubResource hostGroup; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineInstanceViewInner instanceView; + + /* + * Specifies that the image or disk that is being used was licensed + * on-premises.

    Possible values for Windows Server operating + * system are:

    Windows_Client

    Windows_Server

    + * Possible values for Linux Server operating system are:

    + * RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + *

    [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + *

    Minimum api-version: 2015-06-15 + */ + @JsonProperty(value = "properties.licenseType") + private String licenseType; + + /* + * Specifies the VM unique ID which is a 128-bits identifier that is + * encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + * platform BIOS commands. + */ + @JsonProperty(value = "properties.vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /* + * Specifies the time alloted for all extensions to start. The time + * duration should be between 15 minutes and 120 minutes (inclusive) and + * should be specified in ISO 8601 format. The default value is 90 minutes + * (PT1H30M).

    Minimum api-version: 2020-06-01 + */ + @JsonProperty(value = "properties.extensionsTimeBudget") + private String extensionsTimeBudget; + + /* + * Specifies the scale set logical fault domain into which the Virtual + * Machine will be created. By default, the Virtual Machine will by + * automatically assigned to a fault domain that best maintains balance + * across available fault domains.
  • This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.
  • The + * Virtual Machine Scale Set that is referenced, must have + * 'platformFaultDomainCount' > 1.
  • This property cannot be updated + * once the Virtual Machine is created.
  • Fault domain assignment can be + * viewed in the Virtual Machine Instance View.

    Minimum api‐version: + * 2020‐12‐01 + */ + @JsonProperty(value = "properties.platformFaultDomain") + private Integer platformFaultDomain; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "properties.scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here.

    Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "properties.userData") + private String userData; + + /* + * Specifies information about the capacity reservation that is used to + * allocate virtual machine.

    Minimum api-version: 2021-04-01. + */ + @JsonProperty(value = "properties.capacityReservation") + private CapacityReservationProfile capacityReservation; + + /** + * Get the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable + * the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then + * click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @param plan the plan value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the identity property: The identity of the virtual machine, if configured. + * + * @return the identity value. + */ + public VirtualMachineIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the virtual machine, if configured. + * + * @param identity the identity value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withIdentity(VirtualMachineIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the zones property: The virtual machine zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The virtual machine zones. + * + * @param zones the zones value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some + * of the settings cannot be changed once VM is provisioned. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings used while creating the virtual machine. Some + * of the settings cannot be changed once VM is provisioned. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @param availabilitySet the availabilitySet value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withAvailabilitySet(SubResource availabilitySet) { + this.availabilitySet = availabilitySet; + return this; + } + + /** + * Get the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + public SubResource virtualMachineScaleSet() { + return this.virtualMachineScaleSet; + } + + /** + * Set the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet the virtualMachineScaleSet value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + this.virtualMachineScaleSet = virtualMachineScaleSet; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.priority; + } + + /** + * Set the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @param priority the priority value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withPriority(VirtualMachinePriorityTypes priority) { + this.priority = priority; + return this; + } + + /** + * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.billingProfile; + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + public SubResource host() { + return this.host; + } + + /** + * Set the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @param host the host value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withHost(SubResource host) { + this.host = host; + return this; + } + + /** + * Get the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host + * and hostGroup properties. + * + * @return the hostGroup value. + */ + public SubResource hostGroup() { + return this.hostGroup; + } + + /** + * Set the hostGroup property: Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host + * and hostGroup properties. + * + * @param hostGroup the hostGroup value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withHostGroup(SubResource hostGroup) { + this.hostGroup = hostGroup; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + public VirtualMachineInstanceViewInner instanceView() { + return this.instanceView; + } + + /** + * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in + * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.extensionsTimeBudget; + } + + /** + * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withExtensionsTimeBudget(String extensionsTimeBudget) { + this.extensionsTimeBudget = extensionsTimeBudget; + return this; + } + + /** + * Get the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best + * maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best + * maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineUpdateInner object itself. + */ + public VirtualMachineUpdateInner withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineUpdateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (plan() != null) { + plan().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (instanceView() != null) { + instanceView().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/package-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..12c6f19064121 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ComputeManagementClient. Compute Client. */ +package com.azure.resourcemanager.compute.generated.fluent.models; diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/package-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/package-info.java new file mode 100644 index 0000000000000..a1fd21a378b14 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ComputeManagementClient. Compute Client. */ +package com.azure.resourcemanager.compute.generated.fluent; diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java new file mode 100644 index 0000000000000..fac0abade0665 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AccessUriImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; + +public final class AccessUriImpl implements AccessUri { + private AccessUriInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + AccessUriImpl( + AccessUriInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accessSas() { + return this.innerModel().accessSas(); + } + + public AccessUriInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java new file mode 100644 index 0000000000000..b0947d076bc48 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySet; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySetUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AvailabilitySetImpl implements AvailabilitySet, AvailabilitySet.Definition, AvailabilitySet.Update { + private AvailabilitySetInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public Integer platformUpdateDomainCount() { + return this.innerModel().platformUpdateDomainCount(); + } + + public Integer platformFaultDomainCount() { + return this.innerModel().platformFaultDomainCount(); + } + + public List virtualMachines() { + List inner = this.innerModel().virtualMachines(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AvailabilitySetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String availabilitySetName; + + private AvailabilitySetUpdate updateParameters; + + public AvailabilitySetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AvailabilitySet create() { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .createOrUpdateWithResponse(resourceGroupName, availabilitySetName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AvailabilitySet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .createOrUpdateWithResponse(resourceGroupName, availabilitySetName, this.innerModel(), context) + .getValue(); + return this; + } + + AvailabilitySetImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new AvailabilitySetInner(); + this.serviceManager = serviceManager; + this.availabilitySetName = name; + } + + public AvailabilitySetImpl update() { + this.updateParameters = new AvailabilitySetUpdate(); + return this; + } + + public AvailabilitySet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .updateWithResponse(resourceGroupName, availabilitySetName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public AvailabilitySet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .updateWithResponse(resourceGroupName, availabilitySetName, updateParameters, context) + .getValue(); + return this; + } + + AvailabilitySetImpl( + AvailabilitySetInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.availabilitySetName = Utils.getValueFromIdByName(innerObject.id(), "availabilitySets"); + } + + public AvailabilitySet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, Context.NONE) + .getValue(); + return this; + } + + public AvailabilitySet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAvailabilitySets() + .getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, context) + .getValue(); + return this; + } + + public AvailabilitySetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AvailabilitySetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AvailabilitySetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AvailabilitySetImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public AvailabilitySetImpl withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { + if (isInCreateMode()) { + this.innerModel().withPlatformUpdateDomainCount(platformUpdateDomainCount); + return this; + } else { + this.updateParameters.withPlatformUpdateDomainCount(platformUpdateDomainCount); + return this; + } + } + + public AvailabilitySetImpl withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + if (isInCreateMode()) { + this.innerModel().withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } else { + this.updateParameters.withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } + } + + public AvailabilitySetImpl withVirtualMachines(List virtualMachines) { + if (isInCreateMode()) { + this.innerModel().withVirtualMachines(virtualMachines); + return this; + } else { + this.updateParameters.withVirtualMachines(virtualMachines); + return this; + } + } + + public AvailabilitySetImpl withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } else { + this.updateParameters.withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsClientImpl.java new file mode 100644 index 0000000000000..6f98c47919e05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsClientImpl.java @@ -0,0 +1,1476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.AvailabilitySetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySetListResult; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */ +public final class AvailabilitySetsClientImpl implements AvailabilitySetsClient { + private final ClientLogger logger = new ClientLogger(AvailabilitySetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailabilitySetsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of AvailabilitySetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailabilitySetsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(AvailabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientAvailabilitySets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface AvailabilitySetsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("availabilitySetName") String availabilitySetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AvailabilitySetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("availabilitySetName") String availabilitySetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AvailabilitySetUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("availabilitySetName") String availabilitySetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets/{availabilitySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("availabilitySetName") String availabilitySetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/availabilitySets/{availabilitySetName}/vmSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSizes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("availabilitySetName") String availabilitySetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + + @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); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner createOrUpdate( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { + return createOrUpdateAsync(resourceGroupName, availabilitySetName, parameters).block(); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context).block(); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner update( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + return updateAsync(resourceGroupName, availabilitySetName, parameters).block(); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context).block(); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String availabilitySetName) { + 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String availabilitySetName, 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String availabilitySetName) { + return deleteWithResponseAsync(resourceGroupName, availabilitySetName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String availabilitySetName) { + deleteAsync(resourceGroupName, availabilitySetName).block(); + } + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context) { + return deleteWithResponseAsync(resourceGroupName, availabilitySetName, context).block(); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String availabilitySetName) { + 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String availabilitySetName, 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @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(); + } + }); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName) { + return getByResourceGroupAsync(resourceGroupName, availabilitySetName).block(); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName, context).block(); + } + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand) { + 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + expand, + 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 availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand, 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all availability sets 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 List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all availability sets 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 List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Lists all availability sets in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all availability sets in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all availability sets in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String availabilitySetName) { + 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String availabilitySetName, 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 (availabilitySetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter availabilitySetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync( + String resourceGroupName, String availabilitySetName) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, availabilitySetName)); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync( + String resourceGroupName, String availabilitySetName, Context context) { + return new PagedFlux<>( + () -> listAvailableSizesSinglePageAsync(resourceGroupName, availabilitySetName, context)); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName)); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName, 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 the List Availability Set operation response. + */ + @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 the List Availability Set operation response. + */ + @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)); + } + + /** + * 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 the List Availability Set operation response. + */ + @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 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 List Availability Set operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsImpl.java new file mode 100644 index 0000000000000..bc4e366946811 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/AvailabilitySetsImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.AvailabilitySetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySet; +import com.azure.resourcemanager.compute.generated.models.AvailabilitySets; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSize; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailabilitySetsImpl implements AvailabilitySets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetsImpl.class); + + private final AvailabilitySetsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public AvailabilitySetsImpl( + AvailabilitySetsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String availabilitySetName) { + this.serviceClient().delete(resourceGroupName, availabilitySetName); + } + + public Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, availabilitySetName, context); + } + + 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 Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return Utils.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 PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSizes(String resourceGroupName, String availabilitySetName) { + PagedIterable inner = + this.serviceClient().listAvailableSizes(resourceGroupName, availabilitySetName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context) { + PagedIterable inner = + this.serviceClient().listAvailableSizes(resourceGroupName, availabilitySetName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + public AvailabilitySet 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 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, 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 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, 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 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))); + } + this.deleteWithResponse(resourceGroupName, availabilitySetName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(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 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))); + } + return this.deleteWithResponse(resourceGroupName, availabilitySetName, context); + } + + private AvailabilitySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public AvailabilitySetImpl define(String name) { + return new AvailabilitySetImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java new file mode 100644 index 0000000000000..31fe412b55f2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CapacityReservationGroupImpl + implements CapacityReservationGroup, CapacityReservationGroup.Definition, CapacityReservationGroup.Update { + private CapacityReservationGroupInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capacityReservations() { + List inner = this.innerModel().capacityReservations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualMachinesAssociated() { + List inner = this.innerModel().virtualMachinesAssociated(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapacityReservationGroupInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CapacityReservationGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String capacityReservationGroupName; + + private CapacityReservationGroupUpdate updateParameters; + + public CapacityReservationGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CapacityReservationGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .createOrUpdateWithResponse( + resourceGroupName, capacityReservationGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .createOrUpdateWithResponse(resourceGroupName, capacityReservationGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + CapacityReservationGroupImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CapacityReservationGroupInner(); + this.serviceManager = serviceManager; + this.capacityReservationGroupName = name; + } + + public CapacityReservationGroupImpl update() { + this.updateParameters = new CapacityReservationGroupUpdate(); + return this; + } + + public CapacityReservationGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .updateWithResponse(resourceGroupName, capacityReservationGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .updateWithResponse(resourceGroupName, capacityReservationGroupName, updateParameters, context) + .getValue(); + return this; + } + + CapacityReservationGroupImpl( + CapacityReservationGroupInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.capacityReservationGroupName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservationGroups"); + } + + public CapacityReservationGroup refresh() { + CapacityReservationGroupInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .getByResourceGroupWithResponse( + resourceGroupName, capacityReservationGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservationGroup refresh(Context context) { + CapacityReservationGroupInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservationGroups() + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, localExpand, context) + .getValue(); + return this; + } + + public CapacityReservationGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CapacityReservationGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CapacityReservationGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CapacityReservationGroupImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java new file mode 100644 index 0000000000000..8cd1c634befd4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsClientImpl.java @@ -0,0 +1,1485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupListResult; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CapacityReservationGroupsClient. */ +public final class CapacityReservationGroupsClientImpl implements CapacityReservationGroupsClient { + private final ClientLogger logger = new ClientLogger(CapacityReservationGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CapacityReservationGroupsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CapacityReservationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CapacityReservationGroupsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CapacityReservationGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCapacityReservationGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CapacityReservationGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationGroupUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("$expand") CapacityReservationGroupInstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetCapacityReservationGroups expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetCapacityReservationGroups expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner createOrUpdate( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, capacityReservationGroupName, parameters).block(); + } + + /** + * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only + * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Create capacity reservation Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters, context) + .block(); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner update( + String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters) { + return updateAsync(resourceGroupName, capacityReservationGroupName, parameters).block(); + } + + /** + * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may + * be modified. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param parameters Parameters supplied to the Update capacity reservation Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupUpdate parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, capacityReservationGroupName, parameters, context).block(); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName) { + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String capacityReservationGroupName) { + return deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 capacityReservationGroupName) { + deleteAsync(resourceGroupName, capacityReservationGroupName).block(); + } + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, context).block(); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand) { + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, capacityReservationGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String capacityReservationGroupName) { + final CapacityReservationGroupInstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, capacityReservationGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationGroupInner getByResourceGroup( + String resourceGroupName, String capacityReservationGroupName) { + final CapacityReservationGroupInstanceViewTypes expand = null; + return getByResourceGroupAsync(resourceGroupName, capacityReservationGroupName, expand).block(); + } + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, capacityReservationGroupName, expand, context) + .block(); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand) { + 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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + 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 capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, 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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand)); + } + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, context)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + ExpandTypesForGetCapacityReservationGroups expand) { + 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + expand, + 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 capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + ExpandTypesForGetCapacityReservationGroups expand, 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(ExpandTypesForGetCapacityReservationGroups expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final ExpandTypesForGetCapacityReservationGroups expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java new file mode 100644 index 0000000000000..561786fe22707 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationGroupsImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroups; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CapacityReservationGroupsImpl implements CapacityReservationGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationGroupsImpl.class); + + private final CapacityReservationGroupsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CapacityReservationGroupsImpl( + CapacityReservationGroupsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String capacityReservationGroupName) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName); + } + + public Response deleteWithResponse( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, capacityReservationGroupName, context); + } + + public CapacityReservationGroup getByResourceGroup(String resourceGroupName, String capacityReservationGroupName) { + CapacityReservationGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, capacityReservationGroupName); + if (inner != null) { + return new CapacityReservationGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapacityReservationGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + ExpandTypesForGetCapacityReservationGroups expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationGroupImpl(inner1, this.manager())); + } + + public CapacityReservationGroup 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + CapacityReservationGroupInstanceViewTypes localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, CapacityReservationGroupInstanceViewTypes expand, 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, capacityReservationGroupName, expand, 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + this.deleteWithResponse(resourceGroupName, capacityReservationGroupName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, capacityReservationGroupName, context); + } + + private CapacityReservationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CapacityReservationGroupImpl define(String name) { + return new CapacityReservationGroupImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java new file mode 100644 index 0000000000000..a2a35ed34af76 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceView; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CapacityReservationImpl + implements CapacityReservation, CapacityReservation.Definition, CapacityReservation.Update { + private CapacityReservationInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String reservationId() { + return this.innerModel().reservationId(); + } + + public List virtualMachinesAssociated() { + List inner = this.innerModel().virtualMachinesAssociated(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime provisioningTime() { + return this.innerModel().provisioningTime(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public CapacityReservationInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CapacityReservationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String capacityReservationGroupName; + + private String capacityReservationName; + + private CapacityReservationUpdate updateParameters; + + public CapacityReservationImpl withExistingCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + this.resourceGroupName = resourceGroupName; + this.capacityReservationGroupName = capacityReservationGroupName; + return this; + } + + public CapacityReservation create() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + this.innerModel(), + Context.NONE); + return this; + } + + public CapacityReservation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .createOrUpdate( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + this.innerModel(), + context); + return this; + } + + CapacityReservationImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CapacityReservationInner(); + this.serviceManager = serviceManager; + this.capacityReservationName = name; + } + + public CapacityReservationImpl update() { + this.updateParameters = new CapacityReservationUpdate(); + return this; + } + + public CapacityReservation apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .update( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + updateParameters, + Context.NONE); + return this; + } + + public CapacityReservation apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .update( + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + updateParameters, + context); + return this; + } + + CapacityReservationImpl( + CapacityReservationInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.capacityReservationGroupName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservationGroups"); + this.capacityReservationName = Utils.getValueFromIdByName(innerObject.id(), "capacityReservations"); + } + + public CapacityReservation refresh() { + CapacityReservationInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CapacityReservation refresh(Context context) { + CapacityReservationInstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCapacityReservations() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, context) + .getValue(); + return this; + } + + public CapacityReservationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CapacityReservationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CapacityReservationImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public CapacityReservationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CapacityReservationImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java new file mode 100644 index 0000000000000..3819b9d7c9723 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsClientImpl.java @@ -0,0 +1,1682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationListResult; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate; +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 CapacityReservationsClient. */ +public final class CapacityReservationsClientImpl implements CapacityReservationsClient { + private final ClientLogger logger = new ClientLogger(CapacityReservationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CapacityReservationsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CapacityReservationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CapacityReservationsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(CapacityReservationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCapacityReservations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CapacityReservationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" + + "/{capacityReservationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" + + "/{capacityReservationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CapacityReservationUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" + + "/{capacityReservationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" + + "/{capacityReservationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @PathParam("capacityReservationName") String capacityReservationName, + @QueryParam("$expand") CapacityReservationInstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByCapacityReservationGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("capacityReservationGroupName") String capacityReservationGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByCapacityReservationGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityReservationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + Context.NONE); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityReservationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + context); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .getSyncPoller(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityReservationInner> beginCreateOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters) { + return createOrUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .block(); + } + + /** + * The operation to create or update a capacity reservation. Please note some properties can be set only during + * capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Create capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner createOrUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .block(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityReservationInner> beginUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + Context.NONE); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityReservationInner> beginUpdateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CapacityReservationInner.class, + CapacityReservationInner.class, + context); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return beginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .getSyncPoller(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityReservationInner> beginUpdate( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return beginUpdateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters) { + return updateAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + .block(); + } + + /** + * The operation to update a capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param parameters Parameters supplied to the Update capacity reservation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner update( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationUpdate parameters, + Context context) { + return updateAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, context) + .block(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName) + .getSyncPoller(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context) + .getSyncPoller(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + return beginDeleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 capacityReservationGroupName, String capacityReservationName) { + deleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName).block(); + } + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 capacityReservationGroupName, + String capacityReservationName, + Context context) { + deleteAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, context).block(); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand) { + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName is required and cannot be null.")); + } + if (capacityReservationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter capacityReservationName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand) { + return getWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + final CapacityReservationInstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityReservationInner get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + final CapacityReservationInstanceViewTypes expand = null; + return getAsync(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand).block(); + } + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, context) + .block(); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupSinglePageAsync( + String resourceGroupName, String capacityReservationGroupName) { + 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCapacityReservationGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + 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())); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupSinglePageAsync( + String resourceGroupName, String capacityReservationGroupName, 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 (capacityReservationGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter capacityReservationGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCapacityReservationGroup( + this.client.getEndpoint(), + resourceGroupName, + capacityReservationGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCapacityReservationGroupAsync( + String resourceGroupName, String capacityReservationGroupName) { + return new PagedFlux<>( + () -> listByCapacityReservationGroupSinglePageAsync(resourceGroupName, capacityReservationGroupName), + nextLink -> listByCapacityReservationGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCapacityReservationGroupAsync( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return new PagedFlux<>( + () -> + listByCapacityReservationGroupSinglePageAsync(resourceGroupName, capacityReservationGroupName, context), + nextLink -> listByCapacityReservationGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + return new PagedIterable<>( + listByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName)); + } + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context) { + return new PagedIterable<>( + listByCapacityReservationGroupAsync(resourceGroupName, capacityReservationGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupNextSinglePageAsync( + 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.listByCapacityReservationGroupNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapacityReservationGroupNextSinglePageAsync( + 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 + .listByCapacityReservationGroupNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java new file mode 100644 index 0000000000000..f38ce58ff7445 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CapacityReservationsImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.azure.resourcemanager.compute.generated.models.CapacityReservation; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.CapacityReservations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CapacityReservationsImpl implements CapacityReservations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationsImpl.class); + + private final CapacityReservationsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CapacityReservationsImpl( + CapacityReservationsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName, capacityReservationName); + } + + public void delete( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + Context context) { + this.serviceClient().delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + } + + public CapacityReservation get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName) { + CapacityReservationInner inner = + this.serviceClient().get(resourceGroupName, capacityReservationGroupName, capacityReservationName); + if (inner != null) { + return new CapacityReservationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapacityReservationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName) { + PagedIterable inner = + this.serviceClient().listByCapacityReservationGroup(resourceGroupName, capacityReservationGroupName); + return Utils.mapPage(inner, inner1 -> new CapacityReservationImpl(inner1, this.manager())); + } + + public PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByCapacityReservationGroup(resourceGroupName, capacityReservationGroupName, context); + return Utils.mapPage(inner, inner1 -> new CapacityReservationImpl(inner1, this.manager())); + } + + public CapacityReservation 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + CapacityReservationInstanceViewTypes localExpand = null; + return this + .getWithResponse( + resourceGroupName, capacityReservationGroupName, capacityReservationName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, CapacityReservationInstanceViewTypes expand, 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + return this + .getWithResponse(resourceGroupName, capacityReservationGroupName, capacityReservationName, expand, 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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + this.delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, Context.NONE); + } + + public void deleteByIdWithResponse(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 capacityReservationGroupName = Utils.getValueFromIdByName(id, "capacityReservationGroups"); + if (capacityReservationGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservationGroups'.", + id))); + } + String capacityReservationName = Utils.getValueFromIdByName(id, "capacityReservations"); + if (capacityReservationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'capacityReservations'.", + id))); + } + this.delete(resourceGroupName, capacityReservationGroupName, capacityReservationName, context); + } + + private CapacityReservationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CapacityReservationImpl define(String name) { + return new CapacityReservationImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java new file mode 100644 index 0000000000000..78712f3d75ce2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.models.CloudService; +import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import java.util.Collections; +import java.util.Map; + +public final class CloudServiceImpl implements CloudService, CloudService.Definition, CloudService.Update { + private CloudServiceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 CloudServiceProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CloudServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudServiceName; + + private CloudServiceUpdate updateParameters; + + public CloudServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudService create() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .createOrUpdate(resourceGroupName, cloudServiceName, this.innerModel(), Context.NONE); + return this; + } + + public CloudService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .createOrUpdate(resourceGroupName, cloudServiceName, this.innerModel(), context); + return this; + } + + CloudServiceImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new CloudServiceInner(); + this.serviceManager = serviceManager; + this.cloudServiceName = name; + } + + public CloudServiceImpl update() { + this.updateParameters = new CloudServiceUpdate(); + return this; + } + + public CloudService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .update(resourceGroupName, cloudServiceName, updateParameters, Context.NONE); + return this; + } + + public CloudService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .update(resourceGroupName, cloudServiceName, updateParameters, context); + return this; + } + + CloudServiceImpl( + CloudServiceInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudServiceName = Utils.getValueFromIdByName(innerObject.id(), "cloudServices"); + } + + public CloudService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, Context.NONE) + .getValue(); + return this; + } + + public CloudService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServices() + .getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.cloudServices().start(resourceGroupName, cloudServiceName); + } + + public void start(Context context) { + serviceManager.cloudServices().start(resourceGroupName, cloudServiceName, context); + } + + public void powerOff() { + serviceManager.cloudServices().powerOff(resourceGroupName, cloudServiceName); + } + + public void powerOff(Context context) { + serviceManager.cloudServices().powerOff(resourceGroupName, cloudServiceName, context); + } + + public void restart(RoleInstances parameters) { + serviceManager.cloudServices().restart(resourceGroupName, cloudServiceName, parameters); + } + + public void restart() { + serviceManager.cloudServices().restart(resourceGroupName, cloudServiceName); + } + + public void restart(RoleInstances parameters, Context context) { + serviceManager.cloudServices().restart(resourceGroupName, cloudServiceName, parameters, context); + } + + public void reimage(RoleInstances parameters) { + serviceManager.cloudServices().reimage(resourceGroupName, cloudServiceName, parameters); + } + + public void reimage() { + serviceManager.cloudServices().reimage(resourceGroupName, cloudServiceName); + } + + public void reimage(RoleInstances parameters, Context context) { + serviceManager.cloudServices().reimage(resourceGroupName, cloudServiceName, parameters, context); + } + + public void rebuild(RoleInstances parameters) { + serviceManager.cloudServices().rebuild(resourceGroupName, cloudServiceName, parameters); + } + + public void rebuild() { + serviceManager.cloudServices().rebuild(resourceGroupName, cloudServiceName); + } + + public void rebuild(RoleInstances parameters, Context context) { + serviceManager.cloudServices().rebuild(resourceGroupName, cloudServiceName, parameters, context); + } + + public void deleteInstances(RoleInstances parameters) { + serviceManager.cloudServices().deleteInstances(resourceGroupName, cloudServiceName, parameters); + } + + public void deleteInstances() { + serviceManager.cloudServices().deleteInstances(resourceGroupName, cloudServiceName); + } + + public void deleteInstances(RoleInstances parameters, Context context) { + serviceManager.cloudServices().deleteInstances(resourceGroupName, cloudServiceName, parameters, context); + } + + public CloudServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CloudServiceImpl withProperties(CloudServiceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.java new file mode 100644 index 0000000000000..c4ad3630d182a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceInstanceViewImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceInstanceView; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import java.util.Collections; +import java.util.List; + +public final class CloudServiceInstanceViewImpl implements CloudServiceInstanceView { + private CloudServiceInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CloudServiceInstanceViewImpl( + CloudServiceInstanceViewInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public InstanceViewStatusesSummary roleInstance() { + return this.innerModel().roleInstance(); + } + + public String sdkVersion() { + return this.innerModel().sdkVersion(); + } + + public List privateIds() { + List inner = this.innerModel().privateIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CloudServiceInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java new file mode 100644 index 0000000000000..05c79a9a36d01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsClientImpl.java @@ -0,0 +1,934 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.OSFamilyListResult; +import com.azure.resourcemanager.compute.generated.models.OSVersionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServiceOperatingSystemsClient. */ +public final class CloudServiceOperatingSystemsClientImpl implements CloudServiceOperatingSystemsClient { + private final ClientLogger logger = new ClientLogger(CloudServiceOperatingSystemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudServiceOperatingSystemsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceOperatingSystemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceOperatingSystemsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServiceOperatingSystemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceOperatingSystems to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CloudServiceOperatingSystemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions" + + "/{osVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getOSVersion( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osVersionName") String osVersionName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSVersions( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies" + + "/{osFamilyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getOSFamily( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osFamilyName") String osFamilyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listOSFamilies( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @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(ApiErrorException.class) + Mono> listOSVersionsNext( + @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(ApiErrorException.class) + Mono> listOSFamiliesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSVersionWithResponseAsync(String location, String osVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osVersionName == null) { + return Mono.error(new IllegalArgumentException("Parameter osVersionName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSVersion( + this.client.getEndpoint(), + location, + osVersionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSVersionWithResponseAsync( + String location, String osVersionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osVersionName == null) { + return Mono.error(new IllegalArgumentException("Parameter osVersionName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSVersion( + this.client.getEndpoint(), + location, + osVersionName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSVersionAsync(String location, String osVersionName) { + return getOSVersionWithResponseAsync(location, osVersionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSVersionInner getOSVersion(String location, String osVersionName) { + return getOSVersionAsync(location, osVersionName).block(); + } + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOSVersionWithResponse(String location, String osVersionName, Context context) { + return getOSVersionWithResponseAsync(location, osVersionName, context).block(); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOSVersions( + this.client.getEndpoint(), + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSVersions( + this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSVersionsAsync(String location) { + return new PagedFlux<>( + () -> listOSVersionsSinglePageAsync(location), nextLink -> listOSVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSVersionsAsync(String location, Context context) { + return new PagedFlux<>( + () -> listOSVersionsSinglePageAsync(location, context), + nextLink -> listOSVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSVersions(String location) { + return new PagedIterable<>(listOSVersionsAsync(location)); + } + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSVersions(String location, Context context) { + return new PagedIterable<>(listOSVersionsAsync(location, context)); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSFamilyWithResponseAsync(String location, String osFamilyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osFamilyName == null) { + return Mono.error(new IllegalArgumentException("Parameter osFamilyName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSFamily( + this.client.getEndpoint(), + location, + osFamilyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSFamilyWithResponseAsync( + String location, String osFamilyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osFamilyName == null) { + return Mono.error(new IllegalArgumentException("Parameter osFamilyName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSFamily( + this.client.getEndpoint(), + location, + osFamilyName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSFamilyAsync(String location, String osFamilyName) { + return getOSFamilyWithResponseAsync(location, osFamilyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSFamilyInner getOSFamily(String location, String osFamilyName) { + return getOSFamilyAsync(location, osFamilyName).block(); + } + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOSFamilyWithResponse(String location, String osFamilyName, Context context) { + return getOSFamilyWithResponseAsync(location, osFamilyName, context).block(); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOSFamilies( + this.client.getEndpoint(), + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOSFamilies( + this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSFamiliesAsync(String location) { + return new PagedFlux<>( + () -> listOSFamiliesSinglePageAsync(location), nextLink -> listOSFamiliesNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOSFamiliesAsync(String location, Context context) { + return new PagedFlux<>( + () -> listOSFamiliesSinglePageAsync(location, context), + nextLink -> listOSFamiliesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSFamilies(String location) { + return new PagedIterable<>(listOSFamiliesAsync(location)); + } + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOSFamilies(String location, Context context) { + return new PagedIterable<>(listOSFamiliesAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsNextSinglePageAsync(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.listOSVersionsNext(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 ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSVersionsNextSinglePageAsync(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 + .listOSVersionsNext(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 ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesNextSinglePageAsync(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.listOSFamiliesNext(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 ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOSFamiliesNextSinglePageAsync(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 + .listOSFamiliesNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java new file mode 100644 index 0000000000000..c3f49599aff6f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceOperatingSystemsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceOperatingSystems; +import com.azure.resourcemanager.compute.generated.models.OSFamily; +import com.azure.resourcemanager.compute.generated.models.OSVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudServiceOperatingSystemsImpl implements CloudServiceOperatingSystems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceOperatingSystemsImpl.class); + + private final CloudServiceOperatingSystemsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceOperatingSystemsImpl( + CloudServiceOperatingSystemsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OSVersion getOSVersion(String location, String osVersionName) { + OSVersionInner inner = this.serviceClient().getOSVersion(location, osVersionName); + if (inner != null) { + return new OSVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOSVersionWithResponse(String location, String osVersionName, Context context) { + Response inner = + this.serviceClient().getOSVersionWithResponse(location, osVersionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listOSVersions(String location) { + PagedIterable inner = this.serviceClient().listOSVersions(location); + return Utils.mapPage(inner, inner1 -> new OSVersionImpl(inner1, this.manager())); + } + + public PagedIterable listOSVersions(String location, Context context) { + PagedIterable inner = this.serviceClient().listOSVersions(location, context); + return Utils.mapPage(inner, inner1 -> new OSVersionImpl(inner1, this.manager())); + } + + public OSFamily getOSFamily(String location, String osFamilyName) { + OSFamilyInner inner = this.serviceClient().getOSFamily(location, osFamilyName); + if (inner != null) { + return new OSFamilyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOSFamilyWithResponse(String location, String osFamilyName, Context context) { + Response inner = this.serviceClient().getOSFamilyWithResponse(location, osFamilyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSFamilyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listOSFamilies(String location) { + PagedIterable inner = this.serviceClient().listOSFamilies(location); + return Utils.mapPage(inner, inner1 -> new OSFamilyImpl(inner1, this.manager())); + } + + public PagedIterable listOSFamilies(String location, Context context) { + PagedIterable inner = this.serviceClient().listOSFamilies(location, context); + return Utils.mapPage(inner, inner1 -> new OSFamilyImpl(inner1, this.manager())); + } + + private CloudServiceOperatingSystemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.java new file mode 100644 index 0000000000000..cd6057c90628f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRole; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProperties; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku; + +public final class CloudServiceRoleImpl implements CloudServiceRole { + private CloudServiceRoleInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + CloudServiceRoleImpl( + CloudServiceRoleInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 String location() { + return this.innerModel().location(); + } + + public CloudServiceRoleSku sku() { + return this.innerModel().sku(); + } + + public CloudServiceRoleProperties properties() { + return this.innerModel().properties(); + } + + public CloudServiceRoleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java new file mode 100644 index 0000000000000..04e68e1be3931 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesClientImpl.java @@ -0,0 +1,2131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.http.rest.StreamResponse; +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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceListResult; +import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.nio.ByteBuffer; +import java.util.Enumeration; +import java.util.Iterator; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServiceRoleInstancesClient. */ +public final class CloudServiceRoleInstancesClientImpl implements CloudServiceRoleInstancesClient { + private final ClientLogger logger = new ClientLogger(CloudServiceRoleInstancesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudServiceRoleInstancesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceRoleInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceRoleInstancesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServiceRoleInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceRoleInstances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CloudServiceRoleInstancesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") InstanceViewTypes expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") InstanceViewTypes expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> rebuild( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getRemoteDesktopFile( + @HostParam("$host") String endpoint, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + deleteWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName) { + deleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + deleteAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + return getWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInstanceInner get(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return getAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand).block(); + } + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + return getWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand, context).block(); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInstanceViewInner getInstanceView( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getInstanceViewAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return getInstanceViewWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + final InstanceViewTypes expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, expand)); + } + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, expand, context)); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + restartWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName) { + restartAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + restartAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + reimageWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + reimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + reimageAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rebuild( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rebuild( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Mono>> mono = + rebuildWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rebuildWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRebuild( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return beginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + rebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).block(); + } + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + rebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName 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 a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRemoteDesktopFileWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/x-rdp"; + return FluxUtil + .withContext( + context -> + service + .getRemoteDesktopFile( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName 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 a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRemoteDesktopFileWithResponseAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleInstanceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/x-rdp"; + context = this.client.mergeContext(context); + return service + .getRemoteDesktopFile( + this.client.getEndpoint(), + roleInstanceName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName 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 a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Flux getRemoteDesktopFileAsync( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return getRemoteDesktopFileWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .flatMapMany(StreamResponse::getValue); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName 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 a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InputStream getRemoteDesktopFile( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + Iterator iterator = + getRemoteDesktopFileAsync(roleInstanceName, resourceGroupName, cloudServiceName) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); + } + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName 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 a remote desktop file for a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamResponse getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return getRemoteDesktopFileWithResponseAsync(roleInstanceName, resourceGroupName, cloudServiceName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java new file mode 100644 index 0000000000000..e1c95ee985614 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRoleInstancesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.http.rest.StreamResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleInstances; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RoleInstance; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.io.InputStream; + +public final class CloudServiceRoleInstancesImpl implements CloudServiceRoleInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleInstancesImpl.class); + + private final CloudServiceRoleInstancesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceRoleInstancesImpl( + CloudServiceRoleInstancesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().delete(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().delete(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public RoleInstance get(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + RoleInstanceInner inner = this.serviceClient().get(roleInstanceName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new RoleInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleInstanceView getInstanceView( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + RoleInstanceViewInner inner = + this.serviceClient().getInstanceView(roleInstanceName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new RoleInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this + .serviceClient() + .getInstanceViewWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, cloudServiceName, expand, context); + return Utils.mapPage(inner, inner1 -> new RoleInstanceImpl(inner1, this.manager())); + } + + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().restart(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().restart(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().reimage(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().reimage(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName) { + this.serviceClient().rebuild(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().rebuild(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + public InputStream getRemoteDesktopFile( + String roleInstanceName, String resourceGroupName, String cloudServiceName) { + return this.serviceClient().getRemoteDesktopFile(roleInstanceName, resourceGroupName, cloudServiceName); + } + + public StreamResponse getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context) { + return this + .serviceClient() + .getRemoteDesktopFileWithResponse(roleInstanceName, resourceGroupName, cloudServiceName, context); + } + + private CloudServiceRoleInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java new file mode 100644 index 0000000000000..9dacb499f08a6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesClientImpl.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CloudServiceRolesClient. */ +public final class CloudServiceRolesClientImpl implements CloudServiceRolesClient { + private final ClientLogger logger = new ClientLogger(CloudServiceRolesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudServiceRolesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServiceRolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServiceRolesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(CloudServiceRolesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServiceRoles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CloudServiceRolesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roles/{roleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("roleName") String roleName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleName, String resourceGroupName, String cloudServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + roleName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + roleName, + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String roleName, String resourceGroupName, String cloudServiceName) { + return getWithResponseAsync(roleName, resourceGroupName, cloudServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceRoleInner get(String roleName, String resourceGroupName, String cloudServiceName) { + return getAsync(roleName, resourceGroupName, cloudServiceName).block(); + } + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + return getWithResponseAsync(roleName, resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java new file mode 100644 index 0000000000000..5bf84ca6b0c84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServiceRolesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRole; +import com.azure.resourcemanager.compute.generated.models.CloudServiceRoles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudServiceRolesImpl implements CloudServiceRoles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRolesImpl.class); + + private final CloudServiceRolesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServiceRolesImpl( + CloudServiceRolesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CloudServiceRole get(String roleName, String resourceGroupName, String cloudServiceName) { + CloudServiceRoleInner inner = this.serviceClient().get(roleName, resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceRoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(roleName, resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceRoleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new CloudServiceRoleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new CloudServiceRoleImpl(inner1, this.manager())); + } + + private CloudServiceRolesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java new file mode 100644 index 0000000000000..d4b701b1a88cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesClientImpl.java @@ -0,0 +1,3537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.CloudServiceListResult; +import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +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 CloudServicesClient. */ +public final class CloudServicesClientImpl implements CloudServicesClient { + private final ClientLogger logger = new ClientLogger(CloudServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudServicesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServicesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(CloudServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CloudServicesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CloudServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CloudServiceUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/rebuild") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> rebuild( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/delete") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> deleteInstances( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInstances parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, Context.NONE); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, context); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudServiceInner> beginCreateOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner createOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName) { + final CloudServiceInner parameters = null; + return createOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Create or update a cloud service. Please note some properties can be set only during cloud service creation. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner createOrUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudServiceInner> beginUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, Context.NONE); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudServiceInner> beginUpdateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudServiceInner.class, CloudServiceInner.class, context); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudServiceInner> beginUpdate( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner update(String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters) { + return updateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner update(String resourceGroupName, String cloudServiceName) { + final CloudServiceUpdate parameters = null; + return updateAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Update a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters The cloud service object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner update( + String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context) { + return updateAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudServiceName) { + return beginDeleteAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName) { + deleteAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName, Context context) { + deleteAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String cloudServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInner getByResourceGroup(String resourceGroupName, String cloudServiceName) { + return getByResourceGroupAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String cloudServiceName) { + return getInstanceViewWithResponseAsync(resourceGroupName, cloudServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServiceInstanceViewInner getInstanceView(String resourceGroupName, String cloudServiceName) { + return getInstanceViewAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName) { + return beginStartAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String cloudServiceName, Context context) { + return beginStartAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String cloudServiceName) { + return beginStartAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginStartAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName) { + startAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName, Context context) { + startAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync(String resourceGroupName, String cloudServiceName) { + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, cloudServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String cloudServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, cloudServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff(String resourceGroupName, String cloudServiceName) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName).getSyncPoller(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String cloudServiceName, Context context) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName, context).getSyncPoller(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String cloudServiceName) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String cloudServiceName, Context context) { + return beginPowerOffAsync(resourceGroupName, cloudServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 powerOff(String resourceGroupName, String cloudServiceName) { + powerOffAsync(resourceGroupName, cloudServiceName).block(); + } + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 powerOff(String resourceGroupName, String cloudServiceName, Context context) { + powerOffAsync(resourceGroupName, cloudServiceName, context).block(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRestartAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName, RoleInstances parameters) { + restartAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName) { + final RoleInstances parameters = null; + restartAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 cloudServiceName, RoleInstances parameters, Context context) { + restartAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginReimageAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + reimageAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + reimageAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + reimageAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rebuild( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rebuildWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rebuild( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + rebuildWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rebuildWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRebuild( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rebuildAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginRebuildAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + rebuildAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + rebuildAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + rebuildAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, cloudServiceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, cloudServiceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters).getSyncPoller(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context).getSyncPoller(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + return beginDeleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + deleteInstancesAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 deleteInstances(String resourceGroupName, String cloudServiceName) { + final RoleInstances parameters = null; + deleteInstancesAsync(resourceGroupName, cloudServiceName, parameters).block(); + } + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 deleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + deleteInstancesAsync(resourceGroupName, cloudServiceName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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 ApiErrorException 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. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java new file mode 100644 index 0000000000000..8448f7e9ad125 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.CloudService; +import com.azure.resourcemanager.compute.generated.models.CloudServiceInstanceView; +import com.azure.resourcemanager.compute.generated.models.CloudServices; +import com.azure.resourcemanager.compute.generated.models.RoleInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudServicesImpl implements CloudServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServicesImpl.class); + + private final CloudServicesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServicesImpl( + CloudServicesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String cloudServiceName) { + this.serviceClient().delete(resourceGroupName, cloudServiceName); + } + + public void delete(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, cloudServiceName, context); + } + + public CloudService getByResourceGroup(String resourceGroupName, String cloudServiceName) { + CloudServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudServiceInstanceView getInstanceView(String resourceGroupName, String cloudServiceName) { + CloudServiceInstanceViewInner inner = this.serviceClient().getInstanceView(resourceGroupName, cloudServiceName); + if (inner != null) { + return new CloudServiceInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context) { + Response inner = + this.serviceClient().getInstanceViewWithResponse(resourceGroupName, cloudServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServiceInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CloudServiceImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String cloudServiceName) { + this.serviceClient().start(resourceGroupName, cloudServiceName); + } + + public void start(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().start(resourceGroupName, cloudServiceName, context); + } + + public void powerOff(String resourceGroupName, String cloudServiceName) { + this.serviceClient().powerOff(resourceGroupName, cloudServiceName); + } + + public void powerOff(String resourceGroupName, String cloudServiceName, Context context) { + this.serviceClient().powerOff(resourceGroupName, cloudServiceName, context); + } + + public void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + this.serviceClient().restart(resourceGroupName, cloudServiceName, parameters); + } + + public void restart(String resourceGroupName, String cloudServiceName) { + this.serviceClient().restart(resourceGroupName, cloudServiceName); + } + + public void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().restart(resourceGroupName, cloudServiceName, parameters, context); + } + + public void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + this.serviceClient().reimage(resourceGroupName, cloudServiceName, parameters); + } + + public void reimage(String resourceGroupName, String cloudServiceName) { + this.serviceClient().reimage(resourceGroupName, cloudServiceName); + } + + public void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().reimage(resourceGroupName, cloudServiceName, parameters, context); + } + + public void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + this.serviceClient().rebuild(resourceGroupName, cloudServiceName, parameters); + } + + public void rebuild(String resourceGroupName, String cloudServiceName) { + this.serviceClient().rebuild(resourceGroupName, cloudServiceName); + } + + public void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().rebuild(resourceGroupName, cloudServiceName, parameters, context); + } + + public void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters) { + this.serviceClient().deleteInstances(resourceGroupName, cloudServiceName, parameters); + } + + public void deleteInstances(String resourceGroupName, String cloudServiceName) { + this.serviceClient().deleteInstances(resourceGroupName, cloudServiceName); + } + + public void deleteInstances( + String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context) { + this.serviceClient().deleteInstances(resourceGroupName, cloudServiceName, parameters, context); + } + + public CloudService 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 cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, 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 cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudServiceName, 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 cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + this.delete(resourceGroupName, cloudServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(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 cloudServiceName = Utils.getValueFromIdByName(id, "cloudServices"); + if (cloudServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudServices'.", id))); + } + this.delete(resourceGroupName, cloudServiceName, context); + } + + private CloudServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public CloudServiceImpl define(String name) { + return new CloudServiceImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java new file mode 100644 index 0000000000000..a79931f40cbe4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsClientImpl.java @@ -0,0 +1,896 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.UpdateDomainListResult; +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 CloudServicesUpdateDomainsClient. */ +public final class CloudServicesUpdateDomainsClientImpl implements CloudServicesUpdateDomainsClient { + private final ClientLogger logger = new ClientLogger(CloudServicesUpdateDomainsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudServicesUpdateDomainsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of CloudServicesUpdateDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServicesUpdateDomainsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + CloudServicesUpdateDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientCloudServicesUpdateDomains to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface CloudServicesUpdateDomainsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> walkUpdateDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("updateDomain") int updateDomain, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateDomainInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getUpdateDomain( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("updateDomain") int updateDomain, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/updateDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listUpdateDomains( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @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(ApiErrorException.class) + Mono> listUpdateDomainsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> walkUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .walkUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> walkUpdateDomainWithResponseAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .walkUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginWalkUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + Mono>> mono = + walkUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginWalkUpdateDomainAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + walkUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .getSyncPoller(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginWalkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync(String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono walkUpdateDomainAsync( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + return beginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 walkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + walkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters).block(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + final UpdateDomainInner parameters = null; + walkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters).block(); + } + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + walkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain, parameters, context).block(); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateDomainWithResponseAsync( + String resourceGroupName, String cloudServiceName, int updateDomain, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getUpdateDomain( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + updateDomain, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpdateDomainAsync( + String resourceGroupName, String cloudServiceName, int updateDomain) { + return getUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateDomainInner getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + return getUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).block(); + } + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context) { + return getUpdateDomainWithResponseAsync(resourceGroupName, cloudServiceName, updateDomain, context).block(); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsSinglePageAsync( + String resourceGroupName, String cloudServiceName) { + 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUpdateDomains( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsSinglePageAsync( + String resourceGroupName, String cloudServiceName, 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 (cloudServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudServiceName 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 apiVersion = "2021-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUpdateDomains( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUpdateDomainsAsync(String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listUpdateDomainsSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listUpdateDomainsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUpdateDomainsAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listUpdateDomainsSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listUpdateDomainsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listUpdateDomainsAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>(listUpdateDomainsAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsNextSinglePageAsync(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.listUpdateDomainsNext(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 ApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdateDomainsNextSinglePageAsync( + 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 + .listUpdateDomainsNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java new file mode 100644 index 0000000000000..9ad35a2cde64c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/CloudServicesUpdateDomainsImpl.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.CloudServicesUpdateDomains; +import com.azure.resourcemanager.compute.generated.models.UpdateDomain; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudServicesUpdateDomainsImpl implements CloudServicesUpdateDomains { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServicesUpdateDomainsImpl.class); + + private final CloudServicesUpdateDomainsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public CloudServicesUpdateDomainsImpl( + CloudServicesUpdateDomainsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void walkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters) { + this.serviceClient().walkUpdateDomain(resourceGroupName, cloudServiceName, updateDomain, parameters); + } + + public void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + this.serviceClient().walkUpdateDomain(resourceGroupName, cloudServiceName, updateDomain); + } + + public void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context) { + this.serviceClient().walkUpdateDomain(resourceGroupName, cloudServiceName, updateDomain, parameters, context); + } + + public UpdateDomain getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain) { + UpdateDomainInner inner = + this.serviceClient().getUpdateDomain(resourceGroupName, cloudServiceName, updateDomain); + if (inner != null) { + return new UpdateDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context) { + Response inner = + this + .serviceClient() + .getUpdateDomainWithResponse(resourceGroupName, cloudServiceName, updateDomain, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listUpdateDomains(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new UpdateDomainImpl(inner1, this.manager())); + } + + public PagedIterable listUpdateDomains( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listUpdateDomains(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new UpdateDomainImpl(inner1, this.manager())); + } + + private CloudServicesUpdateDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.java new file mode 100644 index 0000000000000..5b2ac850e1403 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ComputeManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ComputeManagementClientImpl.class}) +public final class ComputeManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ComputeManagementClientBuilder. + */ + public ComputeManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ComputeManagementClientImpl with the provided parameters. + * + * @return an instance of ComputeManagementClientImpl. + */ + public ComputeManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ComputeManagementClientImpl client = + new ComputeManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java new file mode 100644 index 0000000000000..2ec9d673b33db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java @@ -0,0 +1,915 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.compute.generated.fluent.AvailabilitySetsClient; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.CapacityReservationsClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceOperatingSystemsClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRoleInstancesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServiceRolesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesClient; +import com.azure.resourcemanager.compute.generated.fluent.CloudServicesUpdateDomainsClient; +import com.azure.resourcemanager.compute.generated.fluent.ComputeManagementClient; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostsClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskAccessesClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskEncryptionSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.DisksClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.GallerySharingProfilesClient; +import com.azure.resourcemanager.compute.generated.fluent.ImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.compute.generated.fluent.OperationsClient; +import com.azure.resourcemanager.compute.generated.fluent.ProximityPlacementGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.ResourceSkusClient; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.compute.generated.fluent.SshPublicKeysClient; +import com.azure.resourcemanager.compute.generated.fluent.UsagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesEdgeZonesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachinesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +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 ComputeManagementClientImpl type. */ +@ServiceClient(builder = ComputeManagementClientBuilder.class) +public final class ComputeManagementClientImpl implements ComputeManagementClient { + private final ClientLogger logger = new ClientLogger(ComputeManagementClientImpl.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** 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. */ + 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. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.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 ProximityPlacementGroupsClient object to access its operations. */ + private final ProximityPlacementGroupsClient proximityPlacementGroups; + + /** + * Gets the ProximityPlacementGroupsClient object to access its operations. + * + * @return the ProximityPlacementGroupsClient object. + */ + public ProximityPlacementGroupsClient getProximityPlacementGroups() { + return this.proximityPlacementGroups; + } + + /** The DedicatedHostGroupsClient object to access its operations. */ + private final DedicatedHostGroupsClient dedicatedHostGroups; + + /** + * Gets the DedicatedHostGroupsClient object to access its operations. + * + * @return the DedicatedHostGroupsClient object. + */ + public DedicatedHostGroupsClient getDedicatedHostGroups() { + return this.dedicatedHostGroups; + } + + /** The DedicatedHostsClient object to access its operations. */ + private final DedicatedHostsClient dedicatedHosts; + + /** + * Gets the DedicatedHostsClient object to access its operations. + * + * @return the DedicatedHostsClient object. + */ + public DedicatedHostsClient getDedicatedHosts() { + return this.dedicatedHosts; + } + + /** The SshPublicKeysClient object to access its operations. */ + private final SshPublicKeysClient sshPublicKeys; + + /** + * Gets the SshPublicKeysClient object to access its operations. + * + * @return the SshPublicKeysClient object. + */ + public SshPublicKeysClient getSshPublicKeys() { + return this.sshPublicKeys; + } + + /** The VirtualMachineExtensionImagesClient object to access its operations. */ + private final VirtualMachineExtensionImagesClient virtualMachineExtensionImages; + + /** + * Gets the VirtualMachineExtensionImagesClient object to access its operations. + * + * @return the VirtualMachineExtensionImagesClient object. + */ + public VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages() { + return this.virtualMachineExtensionImages; + } + + /** The VirtualMachineExtensionsClient object to access its operations. */ + private final VirtualMachineExtensionsClient virtualMachineExtensions; + + /** + * Gets the VirtualMachineExtensionsClient object to access its operations. + * + * @return the VirtualMachineExtensionsClient object. + */ + public VirtualMachineExtensionsClient getVirtualMachineExtensions() { + return this.virtualMachineExtensions; + } + + /** The VirtualMachineImagesClient object to access its operations. */ + private final VirtualMachineImagesClient virtualMachineImages; + + /** + * Gets the VirtualMachineImagesClient object to access its operations. + * + * @return the VirtualMachineImagesClient object. + */ + public VirtualMachineImagesClient getVirtualMachineImages() { + return this.virtualMachineImages; + } + + /** The VirtualMachineImagesEdgeZonesClient object to access its operations. */ + private final VirtualMachineImagesEdgeZonesClient virtualMachineImagesEdgeZones; + + /** + * Gets the VirtualMachineImagesEdgeZonesClient object to access its operations. + * + * @return the VirtualMachineImagesEdgeZonesClient object. + */ + public VirtualMachineImagesEdgeZonesClient getVirtualMachineImagesEdgeZones() { + return this.virtualMachineImagesEdgeZones; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The VirtualMachinesClient object to access its operations. */ + private final VirtualMachinesClient virtualMachines; + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + public VirtualMachinesClient getVirtualMachines() { + return this.virtualMachines; + } + + /** The VirtualMachineScaleSetsClient object to access its operations. */ + private final VirtualMachineScaleSetsClient virtualMachineScaleSets; + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + public VirtualMachineScaleSetsClient getVirtualMachineScaleSets() { + return this.virtualMachineScaleSets; + } + + /** The VirtualMachineSizesClient object to access its operations. */ + private final VirtualMachineSizesClient virtualMachineSizes; + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + public VirtualMachineSizesClient getVirtualMachineSizes() { + return this.virtualMachineSizes; + } + + /** The ImagesClient object to access its operations. */ + private final ImagesClient images; + + /** + * Gets the ImagesClient object to access its operations. + * + * @return the ImagesClient object. + */ + public ImagesClient getImages() { + return this.images; + } + + /** The RestorePointCollectionsClient object to access its operations. */ + private final RestorePointCollectionsClient restorePointCollections; + + /** + * Gets the RestorePointCollectionsClient object to access its operations. + * + * @return the RestorePointCollectionsClient object. + */ + public RestorePointCollectionsClient getRestorePointCollections() { + return this.restorePointCollections; + } + + /** The RestorePointsClient object to access its operations. */ + private final RestorePointsClient restorePoints; + + /** + * Gets the RestorePointsClient object to access its operations. + * + * @return the RestorePointsClient object. + */ + public RestorePointsClient getRestorePoints() { + return this.restorePoints; + } + + /** The CapacityReservationGroupsClient object to access its operations. */ + private final CapacityReservationGroupsClient capacityReservationGroups; + + /** + * Gets the CapacityReservationGroupsClient object to access its operations. + * + * @return the CapacityReservationGroupsClient object. + */ + public CapacityReservationGroupsClient getCapacityReservationGroups() { + return this.capacityReservationGroups; + } + + /** The CapacityReservationsClient object to access its operations. */ + private final CapacityReservationsClient capacityReservations; + + /** + * Gets the CapacityReservationsClient object to access its operations. + * + * @return the CapacityReservationsClient object. + */ + public CapacityReservationsClient getCapacityReservations() { + return this.capacityReservations; + } + + /** The VirtualMachineScaleSetExtensionsClient object to access its operations. */ + private final VirtualMachineScaleSetExtensionsClient virtualMachineScaleSetExtensions; + + /** + * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations. + * + * @return the VirtualMachineScaleSetExtensionsClient object. + */ + public VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions() { + return this.virtualMachineScaleSetExtensions; + } + + /** The VirtualMachineScaleSetRollingUpgradesClient object to access its operations. */ + private final VirtualMachineScaleSetRollingUpgradesClient virtualMachineScaleSetRollingUpgrades; + + /** + * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations. + * + * @return the VirtualMachineScaleSetRollingUpgradesClient object. + */ + public VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades() { + return this.virtualMachineScaleSetRollingUpgrades; + } + + /** The VirtualMachineScaleSetVMExtensionsClient object to access its operations. */ + private final VirtualMachineScaleSetVMExtensionsClient virtualMachineScaleSetVMExtensions; + + /** + * Gets the VirtualMachineScaleSetVMExtensionsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMExtensionsClient object. + */ + public VirtualMachineScaleSetVMExtensionsClient getVirtualMachineScaleSetVMExtensions() { + return this.virtualMachineScaleSetVMExtensions; + } + + /** The VirtualMachineScaleSetVMsClient object to access its operations. */ + private final VirtualMachineScaleSetVMsClient virtualMachineScaleSetVMs; + + /** + * Gets the VirtualMachineScaleSetVMsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMsClient object. + */ + public VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs() { + return this.virtualMachineScaleSetVMs; + } + + /** The LogAnalyticsClient object to access its operations. */ + private final LogAnalyticsClient logAnalytics; + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + public LogAnalyticsClient getLogAnalytics() { + return this.logAnalytics; + } + + /** The VirtualMachineRunCommandsClient object to access its operations. */ + private final VirtualMachineRunCommandsClient virtualMachineRunCommands; + + /** + * Gets the VirtualMachineRunCommandsClient object to access its operations. + * + * @return the VirtualMachineRunCommandsClient object. + */ + public VirtualMachineRunCommandsClient getVirtualMachineRunCommands() { + return this.virtualMachineRunCommands; + } + + /** The VirtualMachineScaleSetVMRunCommandsClient object to access its operations. */ + private final VirtualMachineScaleSetVMRunCommandsClient virtualMachineScaleSetVMRunCommands; + + /** + * Gets the VirtualMachineScaleSetVMRunCommandsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMRunCommandsClient object. + */ + public VirtualMachineScaleSetVMRunCommandsClient getVirtualMachineScaleSetVMRunCommands() { + return this.virtualMachineScaleSetVMRunCommands; + } + + /** The ResourceSkusClient object to access its operations. */ + private final ResourceSkusClient resourceSkus; + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + public ResourceSkusClient getResourceSkus() { + return this.resourceSkus; + } + + /** The DisksClient object to access its operations. */ + private final DisksClient disks; + + /** + * Gets the DisksClient object to access its operations. + * + * @return the DisksClient object. + */ + public DisksClient getDisks() { + return this.disks; + } + + /** The SnapshotsClient object to access its operations. */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + + /** The DiskEncryptionSetsClient object to access its operations. */ + private final DiskEncryptionSetsClient diskEncryptionSets; + + /** + * Gets the DiskEncryptionSetsClient object to access its operations. + * + * @return the DiskEncryptionSetsClient object. + */ + public DiskEncryptionSetsClient getDiskEncryptionSets() { + return this.diskEncryptionSets; + } + + /** The DiskAccessesClient object to access its operations. */ + private final DiskAccessesClient diskAccesses; + + /** + * Gets the DiskAccessesClient object to access its operations. + * + * @return the DiskAccessesClient object. + */ + public DiskAccessesClient getDiskAccesses() { + return this.diskAccesses; + } + + /** The DiskRestorePointsClient object to access its operations. */ + private final DiskRestorePointsClient diskRestorePoints; + + /** + * Gets the DiskRestorePointsClient object to access its operations. + * + * @return the DiskRestorePointsClient object. + */ + public DiskRestorePointsClient getDiskRestorePoints() { + return this.diskRestorePoints; + } + + /** The GalleriesClient object to access its operations. */ + private final GalleriesClient galleries; + + /** + * Gets the GalleriesClient object to access its operations. + * + * @return the GalleriesClient object. + */ + public GalleriesClient getGalleries() { + return this.galleries; + } + + /** The GalleryImagesClient object to access its operations. */ + private final GalleryImagesClient galleryImages; + + /** + * Gets the GalleryImagesClient object to access its operations. + * + * @return the GalleryImagesClient object. + */ + public GalleryImagesClient getGalleryImages() { + return this.galleryImages; + } + + /** The GalleryImageVersionsClient object to access its operations. */ + private final GalleryImageVersionsClient galleryImageVersions; + + /** + * Gets the GalleryImageVersionsClient object to access its operations. + * + * @return the GalleryImageVersionsClient object. + */ + public GalleryImageVersionsClient getGalleryImageVersions() { + return this.galleryImageVersions; + } + + /** The GalleryApplicationsClient object to access its operations. */ + private final GalleryApplicationsClient galleryApplications; + + /** + * Gets the GalleryApplicationsClient object to access its operations. + * + * @return the GalleryApplicationsClient object. + */ + public GalleryApplicationsClient getGalleryApplications() { + return this.galleryApplications; + } + + /** The GalleryApplicationVersionsClient object to access its operations. */ + private final GalleryApplicationVersionsClient galleryApplicationVersions; + + /** + * Gets the GalleryApplicationVersionsClient object to access its operations. + * + * @return the GalleryApplicationVersionsClient object. + */ + public GalleryApplicationVersionsClient getGalleryApplicationVersions() { + return this.galleryApplicationVersions; + } + + /** The GallerySharingProfilesClient object to access its operations. */ + private final GallerySharingProfilesClient gallerySharingProfiles; + + /** + * Gets the GallerySharingProfilesClient object to access its operations. + * + * @return the GallerySharingProfilesClient object. + */ + public GallerySharingProfilesClient getGallerySharingProfiles() { + return this.gallerySharingProfiles; + } + + /** The SharedGalleriesClient object to access its operations. */ + private final SharedGalleriesClient sharedGalleries; + + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + public SharedGalleriesClient getSharedGalleries() { + return this.sharedGalleries; + } + + /** The SharedGalleryImagesClient object to access its operations. */ + private final SharedGalleryImagesClient sharedGalleryImages; + + /** + * Gets the SharedGalleryImagesClient object to access its operations. + * + * @return the SharedGalleryImagesClient object. + */ + public SharedGalleryImagesClient getSharedGalleryImages() { + return this.sharedGalleryImages; + } + + /** The SharedGalleryImageVersionsClient object to access its operations. */ + private final SharedGalleryImageVersionsClient sharedGalleryImageVersions; + + /** + * Gets the SharedGalleryImageVersionsClient object to access its operations. + * + * @return the SharedGalleryImageVersionsClient object. + */ + public SharedGalleryImageVersionsClient getSharedGalleryImageVersions() { + return this.sharedGalleryImageVersions; + } + + /** The CloudServiceRoleInstancesClient object to access its operations. */ + private final CloudServiceRoleInstancesClient cloudServiceRoleInstances; + + /** + * Gets the CloudServiceRoleInstancesClient object to access its operations. + * + * @return the CloudServiceRoleInstancesClient object. + */ + public CloudServiceRoleInstancesClient getCloudServiceRoleInstances() { + return this.cloudServiceRoleInstances; + } + + /** The CloudServiceRolesClient object to access its operations. */ + private final CloudServiceRolesClient cloudServiceRoles; + + /** + * Gets the CloudServiceRolesClient object to access its operations. + * + * @return the CloudServiceRolesClient object. + */ + public CloudServiceRolesClient getCloudServiceRoles() { + return this.cloudServiceRoles; + } + + /** The CloudServicesClient object to access its operations. */ + private final CloudServicesClient cloudServices; + + /** + * Gets the CloudServicesClient object to access its operations. + * + * @return the CloudServicesClient object. + */ + public CloudServicesClient getCloudServices() { + return this.cloudServices; + } + + /** The CloudServicesUpdateDomainsClient object to access its operations. */ + private final CloudServicesUpdateDomainsClient cloudServicesUpdateDomains; + + /** + * Gets the CloudServicesUpdateDomainsClient object to access its operations. + * + * @return the CloudServicesUpdateDomainsClient object. + */ + public CloudServicesUpdateDomainsClient getCloudServicesUpdateDomains() { + return this.cloudServicesUpdateDomains; + } + + /** The CloudServiceOperatingSystemsClient object to access its operations. */ + private final CloudServiceOperatingSystemsClient cloudServiceOperatingSystems; + + /** + * Gets the CloudServiceOperatingSystemsClient object to access its operations. + * + * @return the CloudServiceOperatingSystemsClient object. + */ + public CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems() { + return this.cloudServiceOperatingSystems; + } + + /** + * Initializes an instance of ComputeManagementClient 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 Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ComputeManagementClientImpl( + 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.operations = new OperationsClientImpl(this); + this.availabilitySets = new AvailabilitySetsClientImpl(this); + this.proximityPlacementGroups = new ProximityPlacementGroupsClientImpl(this); + this.dedicatedHostGroups = new DedicatedHostGroupsClientImpl(this); + this.dedicatedHosts = new DedicatedHostsClientImpl(this); + this.sshPublicKeys = new SshPublicKeysClientImpl(this); + this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesClientImpl(this); + this.virtualMachineExtensions = new VirtualMachineExtensionsClientImpl(this); + this.virtualMachineImages = new VirtualMachineImagesClientImpl(this); + this.virtualMachineImagesEdgeZones = new VirtualMachineImagesEdgeZonesClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + this.virtualMachineScaleSets = new VirtualMachineScaleSetsClientImpl(this); + this.virtualMachineSizes = new VirtualMachineSizesClientImpl(this); + this.images = new ImagesClientImpl(this); + this.restorePointCollections = new RestorePointCollectionsClientImpl(this); + this.restorePoints = new RestorePointsClientImpl(this); + this.capacityReservationGroups = new CapacityReservationGroupsClientImpl(this); + this.capacityReservations = new CapacityReservationsClientImpl(this); + this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsClientImpl(this); + this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesClientImpl(this); + this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsClientImpl(this); + this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsClientImpl(this); + this.logAnalytics = new LogAnalyticsClientImpl(this); + this.virtualMachineRunCommands = new VirtualMachineRunCommandsClientImpl(this); + this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsClientImpl(this); + this.resourceSkus = new ResourceSkusClientImpl(this); + this.disks = new DisksClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); + this.diskEncryptionSets = new DiskEncryptionSetsClientImpl(this); + this.diskAccesses = new DiskAccessesClientImpl(this); + this.diskRestorePoints = new DiskRestorePointsClientImpl(this); + this.galleries = new GalleriesClientImpl(this); + this.galleryImages = new GalleryImagesClientImpl(this); + this.galleryImageVersions = new GalleryImageVersionsClientImpl(this); + this.galleryApplications = new GalleryApplicationsClientImpl(this); + this.galleryApplicationVersions = new GalleryApplicationVersionsClientImpl(this); + this.gallerySharingProfiles = new GallerySharingProfilesClientImpl(this); + this.sharedGalleries = new SharedGalleriesClientImpl(this); + this.sharedGalleryImages = new SharedGalleryImagesClientImpl(this); + this.sharedGalleryImageVersions = new SharedGalleryImageVersionsClientImpl(this); + this.cloudServiceRoleInstances = new CloudServiceRoleInstancesClientImpl(this); + this.cloudServiceRoles = new CloudServiceRolesClientImpl(this); + this.cloudServices = new CloudServicesClientImpl(this); + this.cloudServicesUpdateDomains = new CloudServicesUpdateDomainsClientImpl(this); + this.cloudServiceOperatingSystems = new CloudServiceOperatingSystemsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * 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; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @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); + } + + /** + * 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. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + 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); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeOperationValueImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeOperationValueImpl.java new file mode 100644 index 0000000000000..161e30ab1bb0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeOperationValueImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.azure.resourcemanager.compute.generated.models.ComputeOperationValue; + +public final class ComputeOperationValueImpl implements ComputeOperationValue { + private ComputeOperationValueInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + ComputeOperationValueImpl( + ComputeOperationValueInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String resource() { + return this.innerModel().resource(); + } + + public String description() { + return this.innerModel().description(); + } + + public String provider() { + return this.innerModel().provider(); + } + + public ComputeOperationValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.java new file mode 100644 index 0000000000000..ad083a7c8b31a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroup; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DedicatedHostGroupImpl + implements DedicatedHostGroup, DedicatedHostGroup.Definition, DedicatedHostGroup.Update { + private DedicatedHostGroupInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer platformFaultDomainCount() { + return this.innerModel().platformFaultDomainCount(); + } + + public List hosts() { + List inner = this.innerModel().hosts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DedicatedHostGroupInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Boolean supportAutomaticPlacement() { + return this.innerModel().supportAutomaticPlacement(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DedicatedHostGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hostGroupName; + + private DedicatedHostGroupUpdate updateParameters; + + public DedicatedHostGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DedicatedHostGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .createOrUpdateWithResponse(resourceGroupName, hostGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DedicatedHostGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .createOrUpdateWithResponse(resourceGroupName, hostGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + DedicatedHostGroupImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DedicatedHostGroupInner(); + this.serviceManager = serviceManager; + this.hostGroupName = name; + } + + public DedicatedHostGroupImpl update() { + this.updateParameters = new DedicatedHostGroupUpdate(); + return this; + } + + public DedicatedHostGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .updateWithResponse(resourceGroupName, hostGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DedicatedHostGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .updateWithResponse(resourceGroupName, hostGroupName, updateParameters, context) + .getValue(); + return this; + } + + DedicatedHostGroupImpl( + DedicatedHostGroupInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hostGroupName = Utils.getValueFromIdByName(innerObject.id(), "hostGroups"); + } + + public DedicatedHostGroup refresh() { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .getByResourceGroupWithResponse(resourceGroupName, hostGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public DedicatedHostGroup refresh(Context context) { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHostGroups() + .getByResourceGroupWithResponse(resourceGroupName, hostGroupName, localExpand, context) + .getValue(); + return this; + } + + public DedicatedHostGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DedicatedHostGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DedicatedHostGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DedicatedHostGroupImpl withZones(List zones) { + if (isInCreateMode()) { + this.innerModel().withZones(zones); + return this; + } else { + this.updateParameters.withZones(zones); + return this; + } + } + + public DedicatedHostGroupImpl withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + if (isInCreateMode()) { + this.innerModel().withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } else { + this.updateParameters.withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } + } + + public DedicatedHostGroupImpl withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + if (isInCreateMode()) { + this.innerModel().withSupportAutomaticPlacement(supportAutomaticPlacement); + return this; + } else { + this.updateParameters.withSupportAutomaticPlacement(supportAutomaticPlacement); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java new file mode 100644 index 0000000000000..ada2bb66591c9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java @@ -0,0 +1,1302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupListResult; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DedicatedHostGroupsClient. */ +public final class DedicatedHostGroupsClientImpl implements DedicatedHostGroupsClient { + private final ClientLogger logger = new ClientLogger(DedicatedHostGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DedicatedHostGroupsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DedicatedHostGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DedicatedHostGroupsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(DedicatedHostGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDedicatedHostGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DedicatedHostGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DedicatedHostGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DedicatedHostGroupUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @QueryParam("$expand") InstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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"}) + @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); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner createOrUpdate( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, hostGroupName, parameters).block(); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Create Dedicated Host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context).block(); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner update( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { + return updateAsync(resourceGroupName, hostGroupName, parameters).block(); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Parameters supplied to the Update Dedicated Host Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context).block(); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostGroupName) { + 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String hostGroupName, 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String hostGroupName) { + return deleteWithResponseAsync(resourceGroupName, hostGroupName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hostGroupName) { + deleteAsync(resourceGroupName, hostGroupName).block(); + } + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, hostGroupName, context).block(); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand) { + 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String hostGroupName) { + final InstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName) { + final InstanceViewTypes expand = null; + return getByResourceGroupAsync(resourceGroupName, hostGroupName, expand).block(); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, expand, context).block(); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @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 the List Dedicated Host Group with resource group response. + */ + @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 the List Dedicated Host Group with resource group response. + */ + @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 the List Dedicated Host Group with resource group response. + */ + @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 the List Dedicated Host Group with resource group response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsImpl.java new file mode 100644 index 0000000000000..0025e039449d2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.DedicatedHostGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroup; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroups; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DedicatedHostGroupsImpl implements DedicatedHostGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupsImpl.class); + + private final DedicatedHostGroupsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DedicatedHostGroupsImpl( + DedicatedHostGroupsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String hostGroupName) { + this.serviceClient().delete(resourceGroupName, hostGroupName); + } + + public Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, hostGroupName, context); + } + + public DedicatedHostGroup getByResourceGroup(String resourceGroupName, String hostGroupName) { + DedicatedHostGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, hostGroupName); + if (inner != null) { + return new DedicatedHostGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hostGroupName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DedicatedHostGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DedicatedHostGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DedicatedHostGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DedicatedHostGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DedicatedHostGroupImpl(inner1, this.manager())); + } + + public DedicatedHostGroup 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + InstanceViewTypes localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, hostGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, InstanceViewTypes expand, 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, hostGroupName, expand, 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + this.deleteWithResponse(resourceGroupName, hostGroupName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, hostGroupName, context); + } + + private DedicatedHostGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public DedicatedHostGroupImpl define(String name) { + return new DedicatedHostGroupImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.java new file mode 100644 index 0000000000000..3b008102545ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHost; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostInstanceView; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SubResourceReadOnly; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DedicatedHostImpl implements DedicatedHost, DedicatedHost.Definition, DedicatedHost.Update { + private DedicatedHostInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public Boolean autoReplaceOnFailure() { + return this.innerModel().autoReplaceOnFailure(); + } + + public String hostId() { + return this.innerModel().hostId(); + } + + public List virtualMachines() { + List inner = this.innerModel().virtualMachines(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DedicatedHostLicenseTypes licenseType() { + return this.innerModel().licenseType(); + } + + public OffsetDateTime provisioningTime() { + return this.innerModel().provisioningTime(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public DedicatedHostInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DedicatedHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hostGroupName; + + private String hostname; + + private DedicatedHostUpdate updateParameters; + + public DedicatedHostImpl withExistingHostGroup(String resourceGroupName, String hostGroupName) { + this.resourceGroupName = resourceGroupName; + this.hostGroupName = hostGroupName; + return this; + } + + public DedicatedHost create() { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .createOrUpdate(resourceGroupName, hostGroupName, hostname, this.innerModel(), Context.NONE); + return this; + } + + public DedicatedHost create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .createOrUpdate(resourceGroupName, hostGroupName, hostname, this.innerModel(), context); + return this; + } + + DedicatedHostImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DedicatedHostInner(); + this.serviceManager = serviceManager; + this.hostname = name; + } + + public DedicatedHostImpl update() { + this.updateParameters = new DedicatedHostUpdate(); + return this; + } + + public DedicatedHost apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .update(resourceGroupName, hostGroupName, hostname, updateParameters, Context.NONE); + return this; + } + + public DedicatedHost apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .update(resourceGroupName, hostGroupName, hostname, updateParameters, context); + return this; + } + + DedicatedHostImpl( + DedicatedHostInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hostGroupName = Utils.getValueFromIdByName(innerObject.id(), "hostGroups"); + this.hostname = Utils.getValueFromIdByName(innerObject.id(), "hosts"); + } + + public DedicatedHost refresh() { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .getWithResponse(resourceGroupName, hostGroupName, hostname, localExpand, Context.NONE) + .getValue(); + return this; + } + + public DedicatedHost refresh(Context context) { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDedicatedHosts() + .getWithResponse(resourceGroupName, hostGroupName, hostname, localExpand, context) + .getValue(); + return this; + } + + public DedicatedHostImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DedicatedHostImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DedicatedHostImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public DedicatedHostImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DedicatedHostImpl withPlatformFaultDomain(Integer platformFaultDomain) { + if (isInCreateMode()) { + this.innerModel().withPlatformFaultDomain(platformFaultDomain); + return this; + } else { + this.updateParameters.withPlatformFaultDomain(platformFaultDomain); + return this; + } + } + + public DedicatedHostImpl withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { + if (isInCreateMode()) { + this.innerModel().withAutoReplaceOnFailure(autoReplaceOnFailure); + return this; + } else { + this.updateParameters.withAutoReplaceOnFailure(autoReplaceOnFailure); + return this; + } + } + + public DedicatedHostImpl withLicenseType(DedicatedHostLicenseTypes licenseType) { + if (isInCreateMode()) { + this.innerModel().withLicenseType(licenseType); + return this; + } else { + this.updateParameters.withLicenseType(licenseType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java new file mode 100644 index 0000000000000..1f257fd494c67 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.java @@ -0,0 +1,1480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DedicatedHostsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostListResult; +import com.azure.resourcemanager.compute.generated.models.DedicatedHostUpdate; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +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 DedicatedHostsClient. */ +public final class DedicatedHostsClientImpl implements DedicatedHostsClient { + private final ClientLogger logger = new ClientLogger(DedicatedHostsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DedicatedHostsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DedicatedHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DedicatedHostsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(DedicatedHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDedicatedHosts to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DedicatedHostsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @PathParam("hostName") String hostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DedicatedHostInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @PathParam("hostName") String hostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DedicatedHostUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @PathParam("hostName") String hostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}/hosts/{hostName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @PathParam("hostName") String hostname, + @QueryParam("$expand") InstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" + + "/{hostGroupName}/hosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hostGroupName") String hostGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHostGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DedicatedHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, Context.NONE); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DedicatedHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, context); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).getSyncPoller(); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner createOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Create Dedicated Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner createOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DedicatedHostInner> beginUpdateAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, Context.NONE); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DedicatedHostInner> beginUpdateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class, context); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).getSyncPoller(); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DedicatedHostInner> beginUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).getSyncPoller(); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner update( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + return updateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Parameters supplied to the Update Dedicated Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner update( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname) { + 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String hostGroupName, String hostname) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname) { + return beginDeleteAsync(resourceGroupName, hostGroupName, hostname).getSyncPoller(); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context).getSyncPoller(); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname) { + return beginDeleteAsync(resourceGroupName, hostGroupName, hostname) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { + return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 hostGroupName, String hostname) { + deleteAsync(resourceGroupName, hostGroupName, hostname).block(); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 hostGroupName, String hostname, Context context) { + deleteAsync(resourceGroupName, hostGroupName, hostname, context).block(); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { + 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { + return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String hostGroupName, String hostname) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner get(String resourceGroupName, String hostGroupName, String hostname) { + final InstanceViewTypes expand = null; + return getAsync(resourceGroupName, hostGroupName, hostname, expand).block(); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { + return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand, context).block(); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostGroupSinglePageAsync( + String resourceGroupName, String hostGroupName) { + 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByHostGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + 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())); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostGroupSinglePageAsync( + String resourceGroupName, String hostGroupName, 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 (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByHostGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostGroupAsync(String resourceGroupName, String hostGroupName) { + return new PagedFlux<>( + () -> listByHostGroupSinglePageAsync(resourceGroupName, hostGroupName), + nextLink -> listByHostGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHostGroupAsync( + String resourceGroupName, String hostGroupName, Context context) { + return new PagedFlux<>( + () -> listByHostGroupSinglePageAsync(resourceGroupName, hostGroupName, context), + nextLink -> listByHostGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName) { + return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName)); + } + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostGroup( + String resourceGroupName, String hostGroupName, Context context) { + return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, 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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostGroupNextSinglePageAsync(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.listByHostGroupNext(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 the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHostGroupNextSinglePageAsync( + 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 + .listByHostGroupNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.java new file mode 100644 index 0000000000000..946c701e5c86c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.DedicatedHostsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import com.azure.resourcemanager.compute.generated.models.DedicatedHost; +import com.azure.resourcemanager.compute.generated.models.DedicatedHosts; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DedicatedHostsImpl implements DedicatedHosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostsImpl.class); + + private final DedicatedHostsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DedicatedHostsImpl( + DedicatedHostsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String hostGroupName, String hostname) { + this.serviceClient().delete(resourceGroupName, hostGroupName, hostname); + } + + public void delete(String resourceGroupName, String hostGroupName, String hostname, Context context) { + this.serviceClient().delete(resourceGroupName, hostGroupName, hostname, context); + } + + public DedicatedHost get(String resourceGroupName, String hostGroupName, String hostname) { + DedicatedHostInner inner = this.serviceClient().get(resourceGroupName, hostGroupName, hostname); + if (inner != null) { + return new DedicatedHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, hostGroupName, hostname, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DedicatedHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName) { + PagedIterable inner = + this.serviceClient().listByHostGroup(resourceGroupName, hostGroupName); + return Utils.mapPage(inner, inner1 -> new DedicatedHostImpl(inner1, this.manager())); + } + + public PagedIterable listByHostGroup( + String resourceGroupName, String hostGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByHostGroup(resourceGroupName, hostGroupName, context); + return Utils.mapPage(inner, inner1 -> new DedicatedHostImpl(inner1, this.manager())); + } + + public DedicatedHost 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + String hostname = Utils.getValueFromIdByName(id, "hosts"); + if (hostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hosts'.", id))); + } + InstanceViewTypes localExpand = null; + return this.getWithResponse(resourceGroupName, hostGroupName, hostname, localExpand, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, InstanceViewTypes expand, 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + String hostname = Utils.getValueFromIdByName(id, "hosts"); + if (hostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hosts'.", id))); + } + return this.getWithResponse(resourceGroupName, hostGroupName, hostname, expand, 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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + String hostname = Utils.getValueFromIdByName(id, "hosts"); + if (hostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hosts'.", id))); + } + this.delete(resourceGroupName, hostGroupName, hostname, Context.NONE); + } + + public void deleteByIdWithResponse(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 hostGroupName = Utils.getValueFromIdByName(id, "hostGroups"); + if (hostGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostGroups'.", id))); + } + String hostname = Utils.getValueFromIdByName(id, "hosts"); + if (hostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hosts'.", id))); + } + this.delete(resourceGroupName, hostGroupName, hostname, context); + } + + private DedicatedHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public DedicatedHostImpl define(String name) { + return new DedicatedHostImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.java new file mode 100644 index 0000000000000..6e5d42729f7f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.models.DiskAccess; +import com.azure.resourcemanager.compute.generated.models.DiskAccessUpdate; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnection; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class DiskAccessImpl implements DiskAccess, DiskAccess.Definition, DiskAccess.Update { + private DiskAccessInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DiskAccessInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskAccessName; + + private DiskAccessUpdate updateDiskAccess; + + public DiskAccessImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DiskAccess create() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .createOrUpdate(resourceGroupName, diskAccessName, this.innerModel(), Context.NONE); + return this; + } + + public DiskAccess create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .createOrUpdate(resourceGroupName, diskAccessName, this.innerModel(), context); + return this; + } + + DiskAccessImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DiskAccessInner(); + this.serviceManager = serviceManager; + this.diskAccessName = name; + } + + public DiskAccessImpl update() { + this.updateDiskAccess = new DiskAccessUpdate(); + return this; + } + + public DiskAccess apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .update(resourceGroupName, diskAccessName, updateDiskAccess, Context.NONE); + return this; + } + + public DiskAccess apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .update(resourceGroupName, diskAccessName, updateDiskAccess, context); + return this; + } + + DiskAccessImpl( + DiskAccessInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskAccessName = Utils.getValueFromIdByName(innerObject.id(), "diskAccesses"); + } + + public DiskAccess refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .getByResourceGroupWithResponse(resourceGroupName, diskAccessName, Context.NONE) + .getValue(); + return this; + } + + public DiskAccess refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskAccesses() + .getByResourceGroupWithResponse(resourceGroupName, diskAccessName, context) + .getValue(); + return this; + } + + public DiskAccessImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DiskAccessImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DiskAccessImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDiskAccess.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java new file mode 100644 index 0000000000000..5441bd299f02f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesClientImpl.java @@ -0,0 +1,2996 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DiskAccessesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.DiskAccessList; +import com.azure.resourcemanager.compute.generated.models.DiskAccessUpdate; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnectionListResult; +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 DiskAccessesClient. */ +public final class DiskAccessesClientImpl implements DiskAccessesClient { + private final ClientLogger logger = new ClientLogger(DiskAccessesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiskAccessesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DiskAccessesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiskAccessesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(DiskAccessesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDiskAccesses to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DiskAccessesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskAccessInner diskAccess, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskAccessUpdate diskAccess, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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.Compute/diskAccesses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPrivateLinkResources( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> updateAPrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getAPrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> deleteAPrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskAccesses/{diskAccessName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listPrivateEndpointConnections( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskAccessName") String diskAccessName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listPrivateEndpointConnectionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (diskAccess == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccess is required and cannot be null.")); + } else { + diskAccess.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (diskAccess == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccess is required and cannot be null.")); + } else { + diskAccess.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskAccessInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskAccessName, diskAccess); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskAccessInner.class, DiskAccessInner.class, Context.NONE); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskAccessInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskAccessName, diskAccess, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskAccessInner.class, DiskAccessInner.class, context); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + return beginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).getSyncPoller(); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskAccessInner> beginCreateOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess, context).getSyncPoller(); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + return beginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskAccessInner createOrUpdate(String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess) { + return createOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess).block(); + } + + /** + * Creates or updates a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskAccessInner createOrUpdate( + String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context) { + return createOrUpdateAsync(resourceGroupName, diskAccessName, diskAccess, context).block(); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (diskAccess == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccess is required and cannot be null.")); + } else { + diskAccess.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (diskAccess == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccess is required and cannot be null.")); + } else { + diskAccess.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskAccessInner> beginUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskAccessName, diskAccess); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskAccessInner.class, DiskAccessInner.class, Context.NONE); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskAccessInner> beginUpdateAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskAccessName, diskAccess, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskAccessInner.class, DiskAccessInner.class, context); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + return beginUpdateAsync(resourceGroupName, diskAccessName, diskAccess).getSyncPoller(); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskAccessInner> beginUpdate( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context) { + return beginUpdateAsync(resourceGroupName, diskAccessName, diskAccess, context).getSyncPoller(); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + return beginUpdateAsync(resourceGroupName, diskAccessName, diskAccess) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context) { + return beginUpdateAsync(resourceGroupName, diskAccessName, diskAccess, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskAccessInner update(String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess) { + return updateAsync(resourceGroupName, diskAccessName, diskAccess).block(); + } + + /** + * Updates (patches) a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskAccessInner update( + String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context) { + return updateAsync(resourceGroupName, diskAccessName, diskAccess, context).block(); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskAccessName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskAccessName, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String diskAccessName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskAccessName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskAccessInner getByResourceGroup(String resourceGroupName, String diskAccessName) { + return getByResourceGroupAsync(resourceGroupName, diskAccessName).block(); + } + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskAccessName, context).block(); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String diskAccessName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskAccessName, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskAccessName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskAccessName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String diskAccessName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskAccessName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName) { + return beginDeleteAsync(resourceGroupName, diskAccessName).getSyncPoller(); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String diskAccessName, Context context) { + return beginDeleteAsync(resourceGroupName, diskAccessName, context).getSyncPoller(); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskAccessName) { + return beginDeleteAsync(resourceGroupName, diskAccessName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskAccessName, Context context) { + return beginDeleteAsync(resourceGroupName, diskAccessName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 diskAccessName) { + deleteAsync(resourceGroupName, diskAccessName).block(); + } + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 diskAccessName, Context context) { + deleteAsync(resourceGroupName, diskAccessName, context).block(); + } + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 the disk access resources under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disk access resources under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the disk access resources under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourcesWithResponseAsync( + String resourceGroupName, String diskAccessName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateLinkResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourcesWithResponseAsync( + String resourceGroupName, String diskAccessName, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPrivateLinkResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateLinkResourcesAsync( + String resourceGroupName, String diskAccessName) { + return getPrivateLinkResourcesWithResponseAsync(resourceGroupName, diskAccessName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner getPrivateLinkResources(String resourceGroupName, String diskAccessName) { + return getPrivateLinkResourcesAsync(resourceGroupName, diskAccessName).block(); + } + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + return getPrivateLinkResourcesWithResponseAsync(resourceGroupName, diskAccessName, context).block(); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + privateEndpointConnection, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnectionAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + Mono>> mono = + updateAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnectionAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> + beginUpdateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginUpdateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, context) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAPrivateEndpointConnectionAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginUpdateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAPrivateEndpointConnectionAsync( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginUpdateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return updateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) + .block(); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return updateAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, context) + .block(); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return getAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner getAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return getAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName) + .block(); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + return getAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context) + .block(); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAPrivateEndpointConnectionWithResponseAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + Mono>> mono = + deleteAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteAPrivateEndpointConnectionWithResponseAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return beginDeleteAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + return beginDeleteAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + return beginDeleteAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAPrivateEndpointConnectionAsync( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + return beginDeleteAPrivateEndpointConnectionAsync( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + deleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + deleteAPrivateEndpointConnectionAsync(resourceGroupName, diskAccessName, privateEndpointConnectionName, context) + .block(); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsSinglePageAsync( + String resourceGroupName, String diskAccessName) { + 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + 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 information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsSinglePageAsync( + String resourceGroupName, String diskAccessName, 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 (diskAccessName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskAccessName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String diskAccessName) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, diskAccessName), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String diskAccessName, Context context) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, diskAccessName, context), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink, context)); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, diskAccessName)); + } + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName, Context context) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, diskAccessName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + @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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsNextSinglePageAsync( + 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.listPrivateEndpointConnectionsNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateEndpointConnectionsNextSinglePageAsync( + 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 + .listPrivateEndpointConnectionsNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java new file mode 100644 index 0000000000000..075b2fe067c28 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskAccessesImpl.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.DiskAccessesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.compute.generated.models.DiskAccess; +import com.azure.resourcemanager.compute.generated.models.DiskAccesses; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkResourceListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiskAccessesImpl implements DiskAccesses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskAccessesImpl.class); + + private final DiskAccessesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DiskAccessesImpl( + DiskAccessesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DiskAccess getByResourceGroup(String resourceGroupName, String diskAccessName) { + DiskAccessInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, diskAccessName); + if (inner != null) { + return new DiskAccessImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, diskAccessName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiskAccessImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String diskAccessName) { + this.serviceClient().delete(resourceGroupName, diskAccessName); + } + + public void delete(String resourceGroupName, String diskAccessName, Context context) { + this.serviceClient().delete(resourceGroupName, diskAccessName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DiskAccessImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DiskAccessImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DiskAccessImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DiskAccessImpl(inner1, this.manager())); + } + + public PrivateLinkResourceListResult getPrivateLinkResources(String resourceGroupName, String diskAccessName) { + PrivateLinkResourceListResultInner inner = + this.serviceClient().getPrivateLinkResources(resourceGroupName, diskAccessName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, Context context) { + Response inner = + this.serviceClient().getPrivateLinkResourcesWithResponse(resourceGroupName, diskAccessName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .updateAPrivateEndpointConnection( + resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .updateAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + context); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection getAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .getAPrivateEndpointConnection(resourceGroupName, diskAccessName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getAPrivateEndpointConnectionWithResponse( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName) { + this + .serviceClient() + .deleteAPrivateEndpointConnection(resourceGroupName, diskAccessName, privateEndpointConnectionName); + } + + public void deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context) { + this + .serviceClient() + .deleteAPrivateEndpointConnection( + resourceGroupName, diskAccessName, privateEndpointConnectionName, context); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, diskAccessName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, diskAccessName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public DiskAccess 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 diskAccessName = Utils.getValueFromIdByName(id, "diskAccesses"); + if (diskAccessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskAccesses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskAccessName, 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 diskAccessName = Utils.getValueFromIdByName(id, "diskAccesses"); + if (diskAccessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskAccesses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskAccessName, 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 diskAccessName = Utils.getValueFromIdByName(id, "diskAccesses"); + if (diskAccessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskAccesses'.", id))); + } + this.delete(resourceGroupName, diskAccessName, Context.NONE); + } + + public void deleteByIdWithResponse(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 diskAccessName = Utils.getValueFromIdByName(id, "diskAccesses"); + if (diskAccessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskAccesses'.", id))); + } + this.delete(resourceGroupName, diskAccessName, context); + } + + private DiskAccessesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public DiskAccessImpl define(String name) { + return new DiskAccessImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java new file mode 100644 index 0000000000000..10924ce00cefa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetUpdate; +import com.azure.resourcemanager.compute.generated.models.EncryptionSetIdentity; +import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DiskEncryptionSetImpl + implements DiskEncryptionSet, DiskEncryptionSet.Definition, DiskEncryptionSet.Update { + private DiskEncryptionSetInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 EncryptionSetIdentity identity() { + return this.innerModel().identity(); + } + + public DiskEncryptionSetType encryptionType() { + return this.innerModel().encryptionType(); + } + + public KeyForDiskEncryptionSet activeKey() { + return this.innerModel().activeKey(); + } + + public List previousKeys() { + List inner = this.innerModel().previousKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean rotationToLatestKeyVersionEnabled() { + return this.innerModel().rotationToLatestKeyVersionEnabled(); + } + + public OffsetDateTime lastKeyRotationTimestamp() { + return this.innerModel().lastKeyRotationTimestamp(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DiskEncryptionSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskEncryptionSetName; + + private DiskEncryptionSetUpdate updateDiskEncryptionSet; + + public DiskEncryptionSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DiskEncryptionSet create() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .createOrUpdate(resourceGroupName, diskEncryptionSetName, this.innerModel(), Context.NONE); + return this; + } + + public DiskEncryptionSet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .createOrUpdate(resourceGroupName, diskEncryptionSetName, this.innerModel(), context); + return this; + } + + DiskEncryptionSetImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DiskEncryptionSetInner(); + this.serviceManager = serviceManager; + this.diskEncryptionSetName = name; + } + + public DiskEncryptionSetImpl update() { + this.updateDiskEncryptionSet = new DiskEncryptionSetUpdate(); + return this; + } + + public DiskEncryptionSet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .update(resourceGroupName, diskEncryptionSetName, updateDiskEncryptionSet, Context.NONE); + return this; + } + + public DiskEncryptionSet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .update(resourceGroupName, diskEncryptionSetName, updateDiskEncryptionSet, context); + return this; + } + + DiskEncryptionSetImpl( + DiskEncryptionSetInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskEncryptionSetName = Utils.getValueFromIdByName(innerObject.id(), "diskEncryptionSets"); + } + + public DiskEncryptionSet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, Context.NONE) + .getValue(); + return this; + } + + public DiskEncryptionSet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskEncryptionSets() + .getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, context) + .getValue(); + return this; + } + + public DiskEncryptionSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DiskEncryptionSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DiskEncryptionSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDiskEncryptionSet.withTags(tags); + return this; + } + } + + public DiskEncryptionSetImpl withIdentity(EncryptionSetIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateDiskEncryptionSet.withIdentity(identity); + return this; + } + } + + public DiskEncryptionSetImpl withEncryptionType(DiskEncryptionSetType encryptionType) { + if (isInCreateMode()) { + this.innerModel().withEncryptionType(encryptionType); + return this; + } else { + this.updateDiskEncryptionSet.withEncryptionType(encryptionType); + return this; + } + } + + public DiskEncryptionSetImpl withActiveKey(KeyForDiskEncryptionSet activeKey) { + if (isInCreateMode()) { + this.innerModel().withActiveKey(activeKey); + return this; + } else { + this.updateDiskEncryptionSet.withActiveKey(activeKey); + return this; + } + } + + public DiskEncryptionSetImpl withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + if (isInCreateMode()) { + this.innerModel().withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } else { + this.updateDiskEncryptionSet.withRotationToLatestKeyVersionEnabled(rotationToLatestKeyVersionEnabled); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java new file mode 100644 index 0000000000000..e4fdbac1107f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsClientImpl.java @@ -0,0 +1,1978 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DiskEncryptionSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetList; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetUpdate; +import com.azure.resourcemanager.compute.generated.models.ResourceUriList; +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 DiskEncryptionSetsClient. */ +public final class DiskEncryptionSetsClientImpl implements DiskEncryptionSetsClient { + private final ClientLogger logger = new ClientLogger(DiskEncryptionSetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiskEncryptionSetsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DiskEncryptionSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiskEncryptionSetsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(DiskEncryptionSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDiskEncryptionSets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DiskEncryptionSetsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets/{diskEncryptionSetName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskEncryptionSetName") String diskEncryptionSetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskEncryptionSetInner diskEncryptionSet, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets/{diskEncryptionSetName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskEncryptionSetName") String diskEncryptionSetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskEncryptionSetUpdate diskEncryptionSet, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets/{diskEncryptionSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskEncryptionSetName") String diskEncryptionSetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets/{diskEncryptionSetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskEncryptionSetName") String diskEncryptionSetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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.Compute/diskEncryptionSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/diskEncryptionSets/{diskEncryptionSetName}/associatedResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAssociatedResources( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskEncryptionSetName") String diskEncryptionSetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAssociatedResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiskEncryptionSetInner.class, + DiskEncryptionSetInner.class, + Context.NONE); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiskEncryptionSetInner.class, + DiskEncryptionSetInner.class, + context); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).getSyncPoller(); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) + .getSyncPoller(); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner createOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner createOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskEncryptionSetInner> beginUpdateAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiskEncryptionSetInner.class, + DiskEncryptionSetInner.class, + Context.NONE); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskEncryptionSetInner> beginUpdateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DiskEncryptionSetInner.class, + DiskEncryptionSetInner.class, + context); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).getSyncPoller(); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).getSyncPoller(); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner update( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk encryption set + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner update( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName, 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupAsync(resourceGroupName, diskEncryptionSetName).block(); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName, context).block(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName, 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String diskEncryptionSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String diskEncryptionSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName) { + return beginDeleteAsync(resourceGroupName, diskEncryptionSetName).getSyncPoller(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context).getSyncPoller(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { + return beginDeleteAsync(resourceGroupName, diskEncryptionSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName, Context context) { + return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 diskEncryptionSetName) { + deleteAsync(resourceGroupName, diskEncryptionSetName).block(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 diskEncryptionSetName, Context context) { + deleteAsync(resourceGroupName, diskEncryptionSetName, context).block(); + } + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 the disk encryption sets under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disk encryption sets under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the disk encryption sets under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociatedResourcesSinglePageAsync( + String resourceGroupName, String diskEncryptionSetName) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAssociatedResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + 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 resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociatedResourcesSinglePageAsync( + String resourceGroupName, String diskEncryptionSetName, 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAssociatedResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAssociatedResourcesAsync(String resourceGroupName, String diskEncryptionSetName) { + return new PagedFlux<>( + () -> listAssociatedResourcesSinglePageAsync(resourceGroupName, diskEncryptionSetName), + nextLink -> listAssociatedResourcesNextSinglePageAsync(nextLink)); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAssociatedResourcesAsync( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return new PagedFlux<>( + () -> listAssociatedResourcesSinglePageAsync(resourceGroupName, diskEncryptionSetName, context), + nextLink -> listAssociatedResourcesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociatedResources(String resourceGroupName, String diskEncryptionSetName) { + return new PagedIterable<>(listAssociatedResourcesAsync(resourceGroupName, diskEncryptionSetName)); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociatedResources( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return new PagedIterable<>(listAssociatedResourcesAsync(resourceGroupName, diskEncryptionSetName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociatedResourcesNextSinglePageAsync(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.listAssociatedResourcesNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociatedResourcesNextSinglePageAsync(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 + .listAssociatedResourcesNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.java new file mode 100644 index 0000000000000..da6de895f4150 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.DiskEncryptionSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet; +import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiskEncryptionSetsImpl implements DiskEncryptionSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetsImpl.class); + + private final DiskEncryptionSetsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DiskEncryptionSetsImpl( + DiskEncryptionSetsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DiskEncryptionSet getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { + DiskEncryptionSetInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, diskEncryptionSetName); + if (inner != null) { + return new DiskEncryptionSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiskEncryptionSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { + this.serviceClient().delete(resourceGroupName, diskEncryptionSetName); + } + + public void delete(String resourceGroupName, String diskEncryptionSetName, Context context) { + this.serviceClient().delete(resourceGroupName, diskEncryptionSetName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DiskEncryptionSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DiskEncryptionSetImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DiskEncryptionSetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DiskEncryptionSetImpl(inner1, this.manager())); + } + + public PagedIterable listAssociatedResources(String resourceGroupName, String diskEncryptionSetName) { + return this.serviceClient().listAssociatedResources(resourceGroupName, diskEncryptionSetName); + } + + public PagedIterable listAssociatedResources( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return this.serviceClient().listAssociatedResources(resourceGroupName, diskEncryptionSetName, context); + } + + public DiskEncryptionSet 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 diskEncryptionSetName = Utils.getValueFromIdByName(id, "diskEncryptionSets"); + if (diskEncryptionSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'diskEncryptionSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, 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 diskEncryptionSetName = Utils.getValueFromIdByName(id, "diskEncryptionSets"); + if (diskEncryptionSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'diskEncryptionSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskEncryptionSetName, 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 diskEncryptionSetName = Utils.getValueFromIdByName(id, "diskEncryptionSets"); + if (diskEncryptionSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'diskEncryptionSets'.", id))); + } + this.delete(resourceGroupName, diskEncryptionSetName, Context.NONE); + } + + public void deleteByIdWithResponse(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 diskEncryptionSetName = Utils.getValueFromIdByName(id, "diskEncryptionSets"); + if (diskEncryptionSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'diskEncryptionSets'.", id))); + } + this.delete(resourceGroupName, diskEncryptionSetName, context); + } + + private DiskEncryptionSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public DiskEncryptionSetImpl define(String name) { + return new DiskEncryptionSetImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java new file mode 100644 index 0000000000000..5717f82d875d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.Disk; +import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile; +import com.azure.resourcemanager.compute.generated.models.DiskSku; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.DiskUpdate; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PropertyUpdatesInProgress; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.ShareInfoElement; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DiskImpl implements Disk, Disk.Definition, Disk.Update { + private DiskInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String managedBy() { + return this.innerModel().managedBy(); + } + + public List managedByExtended() { + List inner = this.innerModel().managedByExtended(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiskSku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public PurchasePlanAutoGenerated purchasePlan() { + return this.innerModel().purchasePlan(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public Integer diskSizeGB() { + return this.innerModel().diskSizeGB(); + } + + public Long diskSizeBytes() { + return this.innerModel().diskSizeBytes(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.innerModel().encryptionSettingsCollection(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long diskIopsReadWrite() { + return this.innerModel().diskIopsReadWrite(); + } + + public Long diskMBpsReadWrite() { + return this.innerModel().diskMBpsReadWrite(); + } + + public Long diskIopsReadOnly() { + return this.innerModel().diskIopsReadOnly(); + } + + public Long diskMBpsReadOnly() { + return this.innerModel().diskMBpsReadOnly(); + } + + public DiskState diskState() { + return this.innerModel().diskState(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public Integer maxShares() { + return this.innerModel().maxShares(); + } + + public List shareInfo() { + List inner = this.innerModel().shareInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerModel().networkAccessPolicy(); + } + + public String diskAccessId() { + return this.innerModel().diskAccessId(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public Boolean burstingEnabled() { + return this.innerModel().burstingEnabled(); + } + + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.innerModel().propertyUpdatesInProgress(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public DiskSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DiskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskName; + + private DiskUpdate updateDisk; + + public DiskImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Disk create() { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .createOrUpdate(resourceGroupName, diskName, this.innerModel(), Context.NONE); + return this; + } + + public Disk create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .createOrUpdate(resourceGroupName, diskName, this.innerModel(), context); + return this; + } + + DiskImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new DiskInner(); + this.serviceManager = serviceManager; + this.diskName = name; + } + + public DiskImpl update() { + this.updateDisk = new DiskUpdate(); + return this; + } + + public Disk apply() { + this.innerObject = + serviceManager.serviceClient().getDisks().update(resourceGroupName, diskName, updateDisk, Context.NONE); + return this; + } + + public Disk apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getDisks().update(resourceGroupName, diskName, updateDisk, context); + return this; + } + + DiskImpl(DiskInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskName = Utils.getValueFromIdByName(innerObject.id(), "disks"); + } + + public Disk refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .getByResourceGroupWithResponse(resourceGroupName, diskName, Context.NONE) + .getValue(); + return this; + } + + public Disk refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDisks() + .getByResourceGroupWithResponse(resourceGroupName, diskName, context) + .getValue(); + return this; + } + + public AccessUri grantAccess(GrantAccessData grantAccessData) { + return serviceManager.disks().grantAccess(resourceGroupName, diskName, grantAccessData); + } + + public AccessUri grantAccess(GrantAccessData grantAccessData, Context context) { + return serviceManager.disks().grantAccess(resourceGroupName, diskName, grantAccessData, context); + } + + public void revokeAccess() { + serviceManager.disks().revokeAccess(resourceGroupName, diskName); + } + + public void revokeAccess(Context context) { + serviceManager.disks().revokeAccess(resourceGroupName, diskName, context); + } + + public DiskImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DiskImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DiskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDisk.withTags(tags); + return this; + } + } + + public DiskImpl withSku(DiskSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateDisk.withSku(sku); + return this; + } + } + + public DiskImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public DiskImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public DiskImpl withOsType(OperatingSystemTypes osType) { + if (isInCreateMode()) { + this.innerModel().withOsType(osType); + return this; + } else { + this.updateDisk.withOsType(osType); + return this; + } + } + + public DiskImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public DiskImpl withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + if (isInCreateMode()) { + this.innerModel().withPurchasePlan(purchasePlan); + return this; + } else { + this.updateDisk.withPurchasePlan(purchasePlan); + return this; + } + } + + public DiskImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public DiskImpl withDiskSizeGB(Integer diskSizeGB) { + if (isInCreateMode()) { + this.innerModel().withDiskSizeGB(diskSizeGB); + return this; + } else { + this.updateDisk.withDiskSizeGB(diskSizeGB); + return this; + } + } + + public DiskImpl withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + if (isInCreateMode()) { + this.innerModel().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } else { + this.updateDisk.withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + } + + public DiskImpl withDiskIopsReadWrite(Long diskIopsReadWrite) { + if (isInCreateMode()) { + this.innerModel().withDiskIopsReadWrite(diskIopsReadWrite); + return this; + } else { + this.updateDisk.withDiskIopsReadWrite(diskIopsReadWrite); + return this; + } + } + + public DiskImpl withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + if (isInCreateMode()) { + this.innerModel().withDiskMBpsReadWrite(diskMBpsReadWrite); + return this; + } else { + this.updateDisk.withDiskMBpsReadWrite(diskMBpsReadWrite); + return this; + } + } + + public DiskImpl withDiskIopsReadOnly(Long diskIopsReadOnly) { + if (isInCreateMode()) { + this.innerModel().withDiskIopsReadOnly(diskIopsReadOnly); + return this; + } else { + this.updateDisk.withDiskIopsReadOnly(diskIopsReadOnly); + return this; + } + } + + public DiskImpl withDiskMBpsReadOnly(Long diskMBpsReadOnly) { + if (isInCreateMode()) { + this.innerModel().withDiskMBpsReadOnly(diskMBpsReadOnly); + return this; + } else { + this.updateDisk.withDiskMBpsReadOnly(diskMBpsReadOnly); + return this; + } + } + + public DiskImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateDisk.withEncryption(encryption); + return this; + } + } + + public DiskImpl withMaxShares(Integer maxShares) { + if (isInCreateMode()) { + this.innerModel().withMaxShares(maxShares); + return this; + } else { + this.updateDisk.withMaxShares(maxShares); + return this; + } + } + + public DiskImpl withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + if (isInCreateMode()) { + this.innerModel().withNetworkAccessPolicy(networkAccessPolicy); + return this; + } else { + this.updateDisk.withNetworkAccessPolicy(networkAccessPolicy); + return this; + } + } + + public DiskImpl withDiskAccessId(String diskAccessId) { + if (isInCreateMode()) { + this.innerModel().withDiskAccessId(diskAccessId); + return this; + } else { + this.updateDisk.withDiskAccessId(diskAccessId); + return this; + } + } + + public DiskImpl withTier(String tier) { + if (isInCreateMode()) { + this.innerModel().withTier(tier); + return this; + } else { + this.updateDisk.withTier(tier); + return this; + } + } + + public DiskImpl withBurstingEnabled(Boolean burstingEnabled) { + if (isInCreateMode()) { + this.innerModel().withBurstingEnabled(burstingEnabled); + return this; + } else { + this.updateDisk.withBurstingEnabled(burstingEnabled); + return this; + } + } + + public DiskImpl withSupportsHibernation(Boolean supportsHibernation) { + if (isInCreateMode()) { + this.innerModel().withSupportsHibernation(supportsHibernation); + return this; + } else { + this.updateDisk.withSupportsHibernation(supportsHibernation); + return this; + } + } + + public DiskImpl withSecurityProfile(DiskSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.java new file mode 100644 index 0000000000000..e0678f312c93f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoint; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import java.time.OffsetDateTime; + +public final class DiskRestorePointImpl implements DiskRestorePoint { + private DiskRestorePointInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + DiskRestorePointImpl( + DiskRestorePointInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public String sourceResourceId() { + return this.innerModel().sourceResourceId(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public PurchasePlanAutoGenerated purchasePlan() { + return this.innerModel().purchasePlan(); + } + + public String familyId() { + return this.innerModel().familyId(); + } + + public String sourceUniqueId() { + return this.innerModel().sourceUniqueId(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public DiskRestorePointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java new file mode 100644 index 0000000000000..7be72c79e94bd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java @@ -0,0 +1,1470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePointList; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +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 DiskRestorePointsClient. */ +public final class DiskRestorePointsClientImpl implements DiskRestorePointsClient { + private final ClientLogger logger = new ClientLogger(DiskRestorePointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiskRestorePointsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DiskRestorePointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiskRestorePointsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(DiskRestorePointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDiskRestorePoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DiskRestorePointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}" + + "/diskRestorePoints/{diskRestorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}" + + "/diskRestorePoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByRestorePoint( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}" + + "/diskRestorePoints/{diskRestorePointName}/beginGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> grantAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GrantAccessData grantAccessData, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}" + + "/diskRestorePoints/{diskRestorePointName}/endGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> revokeAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("vmRestorePointName") String vmRestorePointName, + @PathParam("diskRestorePointName") String diskRestorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByRestorePointNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return getWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskRestorePointInner get( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return getAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .block(); + } + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + return getWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .block(); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRestorePointSinglePageAsync( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByRestorePoint( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + apiVersion, + 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 diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRestorePointSinglePageAsync( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRestorePoint( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRestorePointAsync( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName) { + return new PagedFlux<>( + () -> listByRestorePointSinglePageAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName), + nextLink -> listByRestorePointNextSinglePageAsync(nextLink)); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRestorePointAsync( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context) { + return new PagedFlux<>( + () -> + listByRestorePointSinglePageAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, context), + nextLink -> listByRestorePointNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName) { + return new PagedIterable<>( + listByRestorePointAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName)); + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context) { + return new PagedIterable<>( + listByRestorePointAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, context)); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + grantAccessData, + accept, + context); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, Context.NONE); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + grantAccessWithResponseAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .getSyncPoller(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .getSyncPoller(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return beginGrantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + return grantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData) + .block(); + } + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + return grantAccessAsync( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context) + .block(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (vmRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmRestorePointName is required and cannot be null.")); + } + if (diskRestorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskRestorePointName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + Mono>> mono = + revokeAccessWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + revokeAccessWithResponseAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .getSyncPoller(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .getSyncPoller(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + return beginRevokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + revokeAccessAsync(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName) + .block(); + } + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + revokeAccessAsync( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRestorePointNextSinglePageAsync(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.listByRestorePointNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRestorePointNextSinglePageAsync( + 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 + .listByRestorePointNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.java new file mode 100644 index 0000000000000..b8f934903178f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.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.compute.generated.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.compute.generated.fluent.DiskRestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoint; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiskRestorePointsImpl implements DiskRestorePoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskRestorePointsImpl.class); + + private final DiskRestorePointsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DiskRestorePointsImpl( + DiskRestorePointsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DiskRestorePoint get( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + DiskRestorePointInner inner = + this + .serviceClient() + .get(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName); + if (inner != null) { + return new DiskRestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiskRestorePointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName) { + PagedIterable inner = + this.serviceClient().listByRestorePoint(resourceGroupName, restorePointCollectionName, vmRestorePointName); + return Utils.mapPage(inner, inner1 -> new DiskRestorePointImpl(inner1, this.manager())); + } + + public PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByRestorePoint(resourceGroupName, restorePointCollectionName, vmRestorePointName, context); + return Utils.mapPage(inner, inner1 -> new DiskRestorePointImpl(inner1, this.manager())); + } + + public AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData) { + AccessUriInner inner = + this + .serviceClient() + .grantAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context) { + AccessUriInner inner = + this + .serviceClient() + .grantAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + context); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName) { + this + .serviceClient() + .revokeAccess(resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName); + } + + public void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context) { + this + .serviceClient() + .revokeAccess( + resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, context); + } + + private DiskRestorePointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java new file mode 100644 index 0000000000000..02e9ad733de48 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksClientImpl.java @@ -0,0 +1,2088 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.DisksClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.azure.resourcemanager.compute.generated.models.DiskList; +import com.azure.resourcemanager.compute.generated.models.DiskUpdate; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +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 DisksClient. */ +public final class DisksClientImpl implements DisksClient { + private final ClientLogger logger = new ClientLogger(DisksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DisksService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of DisksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DisksClientImpl(ComputeManagementClientImpl client) { + this.service = RestProxy.create(DisksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientDisks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface DisksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskInner disk, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskUpdate disk, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks") + @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.Compute/disks") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}/beginGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> grantAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GrantAccessData grantAccessData, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" + + "/{diskName}/endGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> revokeAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskName") String diskName, + @QueryParam("api-version") String apiVersion, + 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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskName, DiskInner disk) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskName, DiskInner disk, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskName, DiskInner disk) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, Context.NONE); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, context); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk) { + return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk).getSyncPoller(); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context).getSyncPoller(); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { + return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) { + return createOrUpdateAsync(resourceGroupName, diskName, disk).block(); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context) { + return createOrUpdateAsync(resourceGroupName, diskName, disk, context).block(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskName, DiskUpdate disk) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskName, DiskUpdate disk, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskInner> beginUpdateAsync( + String resourceGroupName, String diskName, DiskUpdate disk) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, Context.NONE); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskInner> beginUpdateAsync( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, context); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk) { + return beginUpdateAsync(resourceGroupName, diskName, disk).getSyncPoller(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return beginUpdateAsync(resourceGroupName, diskName, disk, context).getSyncPoller(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { + return beginUpdateAsync(resourceGroupName, diskName, disk) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return beginUpdateAsync(resourceGroupName, diskName, disk, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk) { + return updateAsync(resourceGroupName, diskName, disk).block(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return updateAsync(resourceGroupName, diskName, disk, context).block(); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String diskName) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskName, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + accept, + context); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String diskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { + return getByResourceGroupAsync(resourceGroupName, diskName).block(); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName, context).block(); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String diskName) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskName, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String diskName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName) { + return beginDeleteAsync(resourceGroupName, diskName).getSyncPoller(); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context) { + return beginDeleteAsync(resourceGroupName, diskName, context).getSyncPoller(); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskName) { + return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String diskName, Context context) { + return beginDeleteAsync(resourceGroupName, diskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskName) { + deleteAsync(resourceGroupName, diskName).block(); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskName, Context context) { + deleteAsync(resourceGroupName, diskName, context).block(); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 the disks under 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 List Disks operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the disks under 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 List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + accept, + context); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, Context.NONE); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).getSyncPoller(); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context).getSyncPoller(); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + return grantAccessAsync(resourceGroupName, diskName, grantAccessData).block(); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return grantAccessAsync(resourceGroupName, diskName, grantAccessData, context).block(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync(String resourceGroupName, String diskName) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String diskName, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + context = this.client.mergeContext(context); + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String diskName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, String diskName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName) { + return beginRevokeAccessAsync(resourceGroupName, diskName).getSyncPoller(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, String diskName, Context context) { + return beginRevokeAccessAsync(resourceGroupName, diskName, context).getSyncPoller(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync(String resourceGroupName, String diskName) { + return beginRevokeAccessAsync(resourceGroupName, diskName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync(String resourceGroupName, String diskName, Context context) { + return beginRevokeAccessAsync(resourceGroupName, diskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 revokeAccess(String resourceGroupName, String diskName) { + revokeAccessAsync(resourceGroupName, diskName).block(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 revokeAccess(String resourceGroupName, String diskName, Context context) { + revokeAccessAsync(resourceGroupName, diskName, context).block(); + } + + /** + * 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 the List Disks operation response. + */ + @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 the List Disks operation response. + */ + @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 the List Disks operation response. + */ + @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 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 List Disks operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.java new file mode 100644 index 0000000000000..3ef9da45c6942 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DisksImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.DisksClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.Disk; +import com.azure.resourcemanager.compute.generated.models.Disks; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DisksImpl implements Disks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisksImpl.class); + + private final DisksClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public DisksImpl( + DisksClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Disk getByResourceGroup(String resourceGroupName, String diskName) { + DiskInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, diskName); + if (inner != null) { + return new DiskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, diskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String diskName) { + this.serviceClient().delete(resourceGroupName, diskName); + } + + public void delete(String resourceGroupName, String diskName, Context context) { + this.serviceClient().delete(resourceGroupName, diskName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); + } + + public AccessUri grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + AccessUriInner inner = this.serviceClient().grantAccess(resourceGroupName, diskName, grantAccessData); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public AccessUri grantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + AccessUriInner inner = this.serviceClient().grantAccess(resourceGroupName, diskName, grantAccessData, context); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeAccess(String resourceGroupName, String diskName) { + this.serviceClient().revokeAccess(resourceGroupName, diskName); + } + + public void revokeAccess(String resourceGroupName, String diskName, Context context) { + this.serviceClient().revokeAccess(resourceGroupName, diskName, context); + } + + public Disk 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 diskName = Utils.getValueFromIdByName(id, "disks"); + if (diskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskName, 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 diskName = Utils.getValueFromIdByName(id, "disks"); + if (diskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskName, 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 diskName = Utils.getValueFromIdByName(id, "disks"); + if (diskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); + } + this.delete(resourceGroupName, diskName, Context.NONE); + } + + public void deleteByIdWithResponse(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 diskName = Utils.getValueFromIdByName(id, "disks"); + if (diskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); + } + this.delete(resourceGroupName, diskName, context); + } + + private DisksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public DiskImpl define(String name) { + return new DiskImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java new file mode 100644 index 0000000000000..4f73f9de04992 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesClientImpl.java @@ -0,0 +1,1574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.GalleryList; +import com.azure.resourcemanager.compute.generated.models.GalleryUpdate; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; +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 GalleriesClient. */ +public final class GalleriesClientImpl implements GalleriesClient { + private final ClientLogger logger = new ClientLogger(GalleriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GalleriesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleriesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(GalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleries to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GalleriesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryInner gallery, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryUpdate gallery, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$select") SelectPermissions select, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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.Compute/galleries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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(ApiErrorException.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(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryInner gallery) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, GalleryInner gallery) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, Context.NONE); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, context); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery).getSyncPoller(); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context).getSyncPoller(); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery) { + return createOrUpdateAsync(resourceGroupName, galleryName, gallery).block(); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner createOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, gallery, context).block(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + accept, + context); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryInner> beginUpdateAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, gallery); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, Context.NONE); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryInner> beginUpdateAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, gallery, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class, context); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return beginUpdateAsync(resourceGroupName, galleryName, gallery).getSyncPoller(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, gallery, context).getSyncPoller(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return beginUpdateAsync(resourceGroupName, galleryName, gallery) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, gallery, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return updateAsync(resourceGroupName, galleryName, gallery).block(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Parameters supplied to the update Shared Image Gallery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return updateAsync(resourceGroupName, galleryName, gallery, context).block(); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryName, SelectPermissions select) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + select, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryName, SelectPermissions select, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + select, + accept, + context); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String galleryName, SelectPermissions select) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, select) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String galleryName) { + final SelectPermissions select = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, select) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName) { + final SelectPermissions select = null; + return getByResourceGroupAsync(resourceGroupName, galleryName, select).block(); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryName, SelectPermissions select, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, select, context).block(); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName) { + return beginDeleteAsync(resourceGroupName, galleryName).getSyncPoller(); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, context).getSyncPoller(); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName) { + return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName) { + deleteAsync(resourceGroupName, galleryName).block(); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, Context context) { + deleteAsync(resourceGroupName, galleryName, context).block(); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 galleries under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List galleries under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List galleries under 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List galleries under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List galleries under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List galleries under a subscription. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java new file mode 100644 index 0000000000000..977ffe0818d67 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleriesImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.GalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner; +import com.azure.resourcemanager.compute.generated.models.Galleries; +import com.azure.resourcemanager.compute.generated.models.Gallery; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GalleriesImpl implements Galleries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleriesImpl.class); + + private final GalleriesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GalleriesImpl( + GalleriesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Gallery getByResourceGroup(String resourceGroupName, String galleryName) { + GalleryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, galleryName); + if (inner != null) { + return new GalleryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryName, SelectPermissions select, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, galleryName, select, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String galleryName) { + this.serviceClient().delete(resourceGroupName, galleryName); + } + + public void delete(String resourceGroupName, String galleryName, Context context) { + this.serviceClient().delete(resourceGroupName, galleryName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new GalleryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new GalleryImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new GalleryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new GalleryImpl(inner1, this.manager())); + } + + public Gallery 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + SelectPermissions localSelect = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, SelectPermissions select, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, galleryName, select, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + this.delete(resourceGroupName, galleryName, Context.NONE); + } + + public void deleteByIdWithResponse(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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + this.delete(resourceGroupName, galleryName, context); + } + + private GalleriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public GalleryImpl define(String name) { + return new GalleryImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java new file mode 100644 index 0000000000000..af53fd8d16fc4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationImpl.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplication; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationUpdate; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class GalleryApplicationImpl + implements GalleryApplication, GalleryApplication.Definition, GalleryApplication.Update { + private GalleryApplicationInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String description() { + return this.innerModel().description(); + } + + public String eula() { + return this.innerModel().eula(); + } + + public String privacyStatementUri() { + return this.innerModel().privacyStatementUri(); + } + + public String releaseNoteUri() { + return this.innerModel().releaseNoteUri(); + } + + public OffsetDateTime endOfLifeDate() { + return this.innerModel().endOfLifeDate(); + } + + public OperatingSystemTypes supportedOSType() { + return this.innerModel().supportedOSType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryApplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryName; + + private String galleryApplicationName; + + private GalleryApplicationUpdate updateGalleryApplication; + + public GalleryApplicationImpl withExistingGallery(String resourceGroupName, String galleryName) { + this.resourceGroupName = resourceGroupName; + this.galleryName = galleryName; + return this; + } + + public GalleryApplication create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .createOrUpdate( + resourceGroupName, galleryName, galleryApplicationName, this.innerModel(), Context.NONE); + return this; + } + + public GalleryApplication create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .createOrUpdate(resourceGroupName, galleryName, galleryApplicationName, this.innerModel(), context); + return this; + } + + GalleryApplicationImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new GalleryApplicationInner(); + this.serviceManager = serviceManager; + this.galleryApplicationName = name; + } + + public GalleryApplicationImpl update() { + this.updateGalleryApplication = new GalleryApplicationUpdate(); + return this; + } + + public GalleryApplication apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .update(resourceGroupName, galleryName, galleryApplicationName, updateGalleryApplication, Context.NONE); + return this; + } + + public GalleryApplication apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .update(resourceGroupName, galleryName, galleryApplicationName, updateGalleryApplication, context); + return this; + } + + GalleryApplicationImpl( + GalleryApplicationInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryName = Utils.getValueFromIdByName(innerObject.id(), "galleries"); + this.galleryApplicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + } + + public GalleryApplication refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .getWithResponse(resourceGroupName, galleryName, galleryApplicationName, Context.NONE) + .getValue(); + return this; + } + + public GalleryApplication refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplications() + .getWithResponse(resourceGroupName, galleryName, galleryApplicationName, context) + .getValue(); + return this; + } + + public GalleryApplicationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryApplicationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryApplicationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryApplication.withTags(tags); + return this; + } + } + + public GalleryApplicationImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateGalleryApplication.withDescription(description); + return this; + } + } + + public GalleryApplicationImpl withEula(String eula) { + if (isInCreateMode()) { + this.innerModel().withEula(eula); + return this; + } else { + this.updateGalleryApplication.withEula(eula); + return this; + } + } + + public GalleryApplicationImpl withPrivacyStatementUri(String privacyStatementUri) { + if (isInCreateMode()) { + this.innerModel().withPrivacyStatementUri(privacyStatementUri); + return this; + } else { + this.updateGalleryApplication.withPrivacyStatementUri(privacyStatementUri); + return this; + } + } + + public GalleryApplicationImpl withReleaseNoteUri(String releaseNoteUri) { + if (isInCreateMode()) { + this.innerModel().withReleaseNoteUri(releaseNoteUri); + return this; + } else { + this.updateGalleryApplication.withReleaseNoteUri(releaseNoteUri); + return this; + } + } + + public GalleryApplicationImpl withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + if (isInCreateMode()) { + this.innerModel().withEndOfLifeDate(endOfLifeDate); + return this; + } else { + this.updateGalleryApplication.withEndOfLifeDate(endOfLifeDate); + return this; + } + } + + public GalleryApplicationImpl withSupportedOSType(OperatingSystemTypes supportedOSType) { + if (isInCreateMode()) { + this.innerModel().withSupportedOSType(supportedOSType); + return this; + } else { + this.updateGalleryApplication.withSupportedOSType(supportedOSType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java new file mode 100644 index 0000000000000..9cc7f5607b534 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +import java.util.Collections; +import java.util.Map; + +public final class GalleryApplicationVersionImpl + implements GalleryApplicationVersion, GalleryApplicationVersion.Definition, GalleryApplicationVersion.Update { + private GalleryApplicationVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 GalleryApplicationVersionPublishingProfile publishingProfile() { + return this.innerModel().publishingProfile(); + } + + public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ReplicationStatus replicationStatus() { + return this.innerModel().replicationStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryApplicationVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryName; + + private String galleryApplicationName; + + private String galleryApplicationVersionName; + + private GalleryApplicationVersionUpdate updateGalleryApplicationVersion; + + public GalleryApplicationVersionImpl withExistingApplication( + String resourceGroupName, String galleryName, String galleryApplicationName) { + this.resourceGroupName = resourceGroupName; + this.galleryName = galleryName; + this.galleryApplicationName = galleryApplicationName; + return this; + } + + public GalleryApplicationVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .createOrUpdate( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + this.innerModel(), + Context.NONE); + return this; + } + + public GalleryApplicationVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .createOrUpdate( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + this.innerModel(), + context); + return this; + } + + GalleryApplicationVersionImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new GalleryApplicationVersionInner(); + this.serviceManager = serviceManager; + this.galleryApplicationVersionName = name; + } + + public GalleryApplicationVersionImpl update() { + this.updateGalleryApplicationVersion = new GalleryApplicationVersionUpdate(); + return this; + } + + public GalleryApplicationVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .update( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + updateGalleryApplicationVersion, + Context.NONE); + return this; + } + + public GalleryApplicationVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .update( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + updateGalleryApplicationVersion, + context); + return this; + } + + GalleryApplicationVersionImpl( + GalleryApplicationVersionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryName = Utils.getValueFromIdByName(innerObject.id(), "galleries"); + this.galleryApplicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + this.galleryApplicationVersionName = Utils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public GalleryApplicationVersion refresh() { + ReplicationStatusTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .getWithResponse( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + localExpand, + Context.NONE) + .getValue(); + return this; + } + + public GalleryApplicationVersion refresh(Context context) { + ReplicationStatusTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleryApplicationVersions() + .getWithResponse( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + localExpand, + context) + .getValue(); + return this; + } + + public GalleryApplicationVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryApplicationVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryApplicationVersionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryApplicationVersion.withTags(tags); + return this; + } + } + + public GalleryApplicationVersionImpl withPublishingProfile( + GalleryApplicationVersionPublishingProfile publishingProfile) { + if (isInCreateMode()) { + this.innerModel().withPublishingProfile(publishingProfile); + return this; + } else { + this.updateGalleryApplicationVersion.withPublishingProfile(publishingProfile); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java new file mode 100644 index 0000000000000..d4649253724f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsClientImpl.java @@ -0,0 +1,1961 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionList; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +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 GalleryApplicationVersionsClient. */ +public final class GalleryApplicationVersionsClientImpl implements GalleryApplicationVersionsClient { + private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GalleryApplicationVersionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryApplicationVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryApplicationVersionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + GalleryApplicationVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryApplicationVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GalleryApplicationVersionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryApplicationVersionInner galleryApplicationVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryApplicationVersionUpdate galleryApplicationVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, + @QueryParam("$expand") ReplicationStatusTypes expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryApplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryApplicationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class, + Context.NONE); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationVersionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class, + context); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + return beginCreateOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .getSyncPoller(); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .getSyncPoller(); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + return beginCreateOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + return createOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .block(); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .block(); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + accept, + context); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationVersionInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class, + Context.NONE); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationVersionInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class, + context); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + return beginUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .getSyncPoller(); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return beginUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .getSyncPoller(); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + return beginUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return beginUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + return updateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion) + .block(); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return updateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .block(); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + expand, + apiVersion, + accept, + context); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand) { + return getWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + final ReplicationStatusTypes expand = null; + return getWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner get( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + final ReplicationStatusTypes expand = null; + return getAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) + .block(); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, context) + .block(); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + accept, + context); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) + .getSyncPoller(); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .getSyncPoller(); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).block(); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .block(); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryApplicationSinglePageAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGalleryApplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + 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 gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryApplicationSinglePageAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGalleryApplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryApplicationAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return new PagedFlux<>( + () -> listByGalleryApplicationSinglePageAsync(resourceGroupName, galleryName, galleryApplicationName), + nextLink -> listByGalleryApplicationNextSinglePageAsync(nextLink)); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryApplicationAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return new PagedFlux<>( + () -> + listByGalleryApplicationSinglePageAsync( + resourceGroupName, galleryName, galleryApplicationName, context), + nextLink -> listByGalleryApplicationNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return new PagedIterable<>( + listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName)); + } + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return new PagedIterable<>( + listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryApplicationNextSinglePageAsync( + 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.listByGalleryApplicationNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryApplicationNextSinglePageAsync( + 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 + .listByGalleryApplicationNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java new file mode 100644 index 0000000000000..1be4a16f04b3c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationVersionsImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.GalleryApplicationVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersions; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GalleryApplicationVersionsImpl implements GalleryApplicationVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionsImpl.class); + + private final GalleryApplicationVersionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GalleryApplicationVersionsImpl( + GalleryApplicationVersionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GalleryApplicationVersion get( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + GalleryApplicationVersionInner inner = + this + .serviceClient() + .get(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); + if (inner != null) { + return new GalleryApplicationVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryApplicationVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + this + .serviceClient() + .delete(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); + } + + public void delete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); + } + + public PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName) { + PagedIterable inner = + this.serviceClient().listByGalleryApplication(resourceGroupName, galleryName, galleryApplicationName); + return Utils.mapPage(inner, inner1 -> new GalleryApplicationVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByGalleryApplication(resourceGroupName, galleryName, galleryApplicationName, context); + return Utils.mapPage(inner, inner1 -> new GalleryApplicationVersionImpl(inner1, this.manager())); + } + + public GalleryApplicationVersion 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String galleryApplicationVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryApplicationVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + ReplicationStatusTypes localExpand = null; + return this + .getWithResponse( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + localExpand, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, ReplicationStatusTypes expand, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String galleryApplicationVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryApplicationVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this + .getWithResponse( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String galleryApplicationVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryApplicationVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this + .delete( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String galleryApplicationVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryApplicationVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); + } + + private GalleryApplicationVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public GalleryApplicationVersionImpl define(String name) { + return new GalleryApplicationVersionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java new file mode 100644 index 0000000000000..3c8692a8d7f81 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsClientImpl.java @@ -0,0 +1,1598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GalleryApplicationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationList; +import com.azure.resourcemanager.compute.generated.models.GalleryApplicationUpdate; +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 GalleryApplicationsClient. */ +public final class GalleryApplicationsClientImpl implements GalleryApplicationsClient { + private final ClientLogger logger = new ClientLogger(GalleryApplicationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GalleryApplicationsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryApplicationsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(GalleryApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryApplications to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GalleryApplicationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryApplicationInner galleryApplication, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryApplicationUpdate galleryApplication, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications/{galleryApplicationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryApplicationName") String galleryApplicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/applications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGallery( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationInner.class, + GalleryApplicationInner.class, + Context.NONE); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationInner.class, + GalleryApplicationInner.class, + context); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .getSyncPoller(); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .getSyncPoller(); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Parameters supplied to the create or update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .block(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + accept, + context); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationInner.class, + GalleryApplicationInner.class, + Context.NONE); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryApplicationInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryApplicationInner.class, + GalleryApplicationInner.class, + context); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .getSyncPoller(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .getSyncPoller(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Parameters supplied to the update gallery Application operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context).block(); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName) { + return getAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + accept, + context); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName).getSyncPoller(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context).getSyncPoller(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryApplicationName) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryApplicationName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync( + String resourceGroupName, String galleryName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + 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 gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync( + String resourceGroupName, String galleryName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName) { + return new PagedFlux<>( + () -> listByGallerySinglePageAsync(resourceGroupName, galleryName), + nextLink -> listByGalleryNextSinglePageAsync(nextLink)); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryAsync( + String resourceGroupName, String galleryName, Context context) { + return new PagedFlux<>( + () -> listByGallerySinglePageAsync(resourceGroupName, galleryName, context), + nextLink -> listByGalleryNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery(String resourceGroupName, String galleryName) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); + } + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery( + String resourceGroupName, String galleryName, Context context) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(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.listByGalleryNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync( + 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 + .listByGalleryNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java new file mode 100644 index 0000000000000..181626a0c82c3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryApplicationsImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.GalleryApplicationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import com.azure.resourcemanager.compute.generated.models.GalleryApplication; +import com.azure.resourcemanager.compute.generated.models.GalleryApplications; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GalleryApplicationsImpl implements GalleryApplications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationsImpl.class); + + private final GalleryApplicationsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GalleryApplicationsImpl( + GalleryApplicationsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GalleryApplication get(String resourceGroupName, String galleryName, String galleryApplicationName) { + GalleryApplicationInner inner = + this.serviceClient().get(resourceGroupName, galleryName, galleryApplicationName); + if (inner != null) { + return new GalleryApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, galleryName, galleryApplicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String galleryName, String galleryApplicationName) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryApplicationName); + } + + public void delete(String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryApplicationName, context); + } + + public PagedIterable listByGallery(String resourceGroupName, String galleryName) { + PagedIterable inner = + this.serviceClient().listByGallery(resourceGroupName, galleryName); + return Utils.mapPage(inner, inner1 -> new GalleryApplicationImpl(inner1, this.manager())); + } + + public PagedIterable listByGallery( + String resourceGroupName, String galleryName, Context context) { + PagedIterable inner = + this.serviceClient().listByGallery(resourceGroupName, galleryName, context); + return Utils.mapPage(inner, inner1 -> new GalleryApplicationImpl(inner1, this.manager())); + } + + public GalleryApplication 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, galleryName, galleryApplicationName, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, galleryName, galleryApplicationName, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryApplicationName, Context.NONE); + } + + public void deleteByIdWithResponse(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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryApplicationName = Utils.getValueFromIdByName(id, "applications"); + if (galleryApplicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryApplicationName, context); + } + + private GalleryApplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public GalleryApplicationImpl define(String name) { + return new GalleryApplicationImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java new file mode 100644 index 0000000000000..ac2f487a01c2c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.Disallowed; +import com.azure.resourcemanager.compute.generated.models.GalleryImage; +import com.azure.resourcemanager.compute.generated.models.GalleryImageFeature; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryImagePropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryImageUpdate; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.ImagePurchasePlan; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RecommendedMachineConfiguration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class GalleryImageImpl implements GalleryImage, GalleryImage.Definition, GalleryImage.Update { + private GalleryImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String description() { + return this.innerModel().description(); + } + + public String eula() { + return this.innerModel().eula(); + } + + public String privacyStatementUri() { + return this.innerModel().privacyStatementUri(); + } + + public String releaseNoteUri() { + return this.innerModel().releaseNoteUri(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public OperatingSystemStateTypes osState() { + return this.innerModel().osState(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public OffsetDateTime endOfLifeDate() { + return this.innerModel().endOfLifeDate(); + } + + public GalleryImageIdentifier identifier() { + return this.innerModel().identifier(); + } + + public RecommendedMachineConfiguration recommended() { + return this.innerModel().recommended(); + } + + public Disallowed disallowed() { + return this.innerModel().disallowed(); + } + + public ImagePurchasePlan purchasePlan() { + return this.innerModel().purchasePlan(); + } + + public GalleryImagePropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List features() { + List inner = this.innerModel().features(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryName; + + private String galleryImageName; + + private GalleryImageUpdate updateGalleryImage; + + public GalleryImageImpl withExistingGallery(String resourceGroupName, String galleryName) { + this.resourceGroupName = resourceGroupName; + this.galleryName = galleryName; + return this; + } + + public GalleryImage create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .createOrUpdate(resourceGroupName, galleryName, galleryImageName, this.innerModel(), Context.NONE); + return this; + } + + public GalleryImage create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .createOrUpdate(resourceGroupName, galleryName, galleryImageName, this.innerModel(), context); + return this; + } + + GalleryImageImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new GalleryImageInner(); + this.serviceManager = serviceManager; + this.galleryImageName = name; + } + + public GalleryImageImpl update() { + this.updateGalleryImage = new GalleryImageUpdate(); + return this; + } + + public GalleryImage apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .update(resourceGroupName, galleryName, galleryImageName, updateGalleryImage, Context.NONE); + return this; + } + + public GalleryImage apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .update(resourceGroupName, galleryName, galleryImageName, updateGalleryImage, context); + return this; + } + + GalleryImageImpl( + GalleryImageInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryName = Utils.getValueFromIdByName(innerObject.id(), "galleries"); + this.galleryImageName = Utils.getValueFromIdByName(innerObject.id(), "images"); + } + + public GalleryImage refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .getWithResponse(resourceGroupName, galleryName, galleryImageName, Context.NONE) + .getValue(); + return this; + } + + public GalleryImage refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImages() + .getWithResponse(resourceGroupName, galleryName, galleryImageName, context) + .getValue(); + return this; + } + + public GalleryImageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryImageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryImageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryImage.withTags(tags); + return this; + } + } + + public GalleryImageImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateGalleryImage.withDescription(description); + return this; + } + } + + public GalleryImageImpl withEula(String eula) { + if (isInCreateMode()) { + this.innerModel().withEula(eula); + return this; + } else { + this.updateGalleryImage.withEula(eula); + return this; + } + } + + public GalleryImageImpl withPrivacyStatementUri(String privacyStatementUri) { + if (isInCreateMode()) { + this.innerModel().withPrivacyStatementUri(privacyStatementUri); + return this; + } else { + this.updateGalleryImage.withPrivacyStatementUri(privacyStatementUri); + return this; + } + } + + public GalleryImageImpl withReleaseNoteUri(String releaseNoteUri) { + if (isInCreateMode()) { + this.innerModel().withReleaseNoteUri(releaseNoteUri); + return this; + } else { + this.updateGalleryImage.withReleaseNoteUri(releaseNoteUri); + return this; + } + } + + public GalleryImageImpl withOsType(OperatingSystemTypes osType) { + if (isInCreateMode()) { + this.innerModel().withOsType(osType); + return this; + } else { + this.updateGalleryImage.withOsType(osType); + return this; + } + } + + public GalleryImageImpl withOsState(OperatingSystemStateTypes osState) { + if (isInCreateMode()) { + this.innerModel().withOsState(osState); + return this; + } else { + this.updateGalleryImage.withOsState(osState); + return this; + } + } + + public GalleryImageImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + if (isInCreateMode()) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } else { + this.updateGalleryImage.withHyperVGeneration(hyperVGeneration); + return this; + } + } + + public GalleryImageImpl withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + if (isInCreateMode()) { + this.innerModel().withEndOfLifeDate(endOfLifeDate); + return this; + } else { + this.updateGalleryImage.withEndOfLifeDate(endOfLifeDate); + return this; + } + } + + public GalleryImageImpl withIdentifier(GalleryImageIdentifier identifier) { + if (isInCreateMode()) { + this.innerModel().withIdentifier(identifier); + return this; + } else { + this.updateGalleryImage.withIdentifier(identifier); + return this; + } + } + + public GalleryImageImpl withRecommended(RecommendedMachineConfiguration recommended) { + if (isInCreateMode()) { + this.innerModel().withRecommended(recommended); + return this; + } else { + this.updateGalleryImage.withRecommended(recommended); + return this; + } + } + + public GalleryImageImpl withDisallowed(Disallowed disallowed) { + if (isInCreateMode()) { + this.innerModel().withDisallowed(disallowed); + return this; + } else { + this.updateGalleryImage.withDisallowed(disallowed); + return this; + } + } + + public GalleryImageImpl withPurchasePlan(ImagePurchasePlan purchasePlan) { + if (isInCreateMode()) { + this.innerModel().withPurchasePlan(purchasePlan); + return this; + } else { + this.updateGalleryImage.withPurchasePlan(purchasePlan); + return this; + } + } + + public GalleryImageImpl withFeatures(List features) { + if (isInCreateMode()) { + this.innerModel().withFeatures(features); + return this; + } else { + this.updateGalleryImage.withFeatures(features); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java new file mode 100644 index 0000000000000..c5bc11dcd7340 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatus; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +import java.util.Collections; +import java.util.Map; + +public final class GalleryImageVersionImpl + implements GalleryImageVersion, GalleryImageVersion.Definition, GalleryImageVersion.Update { + private GalleryImageVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 GalleryImageVersionPublishingProfile publishingProfile() { + return this.innerModel().publishingProfile(); + } + + public GalleryImageVersionPropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public GalleryImageVersionStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public ReplicationStatus replicationStatus() { + return this.innerModel().replicationStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryImageVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryName; + + private String galleryImageName; + + private String galleryImageVersionName; + + private GalleryImageVersionUpdate updateGalleryImageVersion; + + public GalleryImageVersionImpl withExistingImage( + String resourceGroupName, String galleryName, String galleryImageName) { + this.resourceGroupName = resourceGroupName; + this.galleryName = galleryName; + this.galleryImageName = galleryImageName; + return this; + } + + public GalleryImageVersion create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .createOrUpdate( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + this.innerModel(), + Context.NONE); + return this; + } + + public GalleryImageVersion create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .createOrUpdate( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + this.innerModel(), + context); + return this; + } + + GalleryImageVersionImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new GalleryImageVersionInner(); + this.serviceManager = serviceManager; + this.galleryImageVersionName = name; + } + + public GalleryImageVersionImpl update() { + this.updateGalleryImageVersion = new GalleryImageVersionUpdate(); + return this; + } + + public GalleryImageVersion apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .update( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + updateGalleryImageVersion, + Context.NONE); + return this; + } + + public GalleryImageVersion apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .update( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + updateGalleryImageVersion, + context); + return this; + } + + GalleryImageVersionImpl( + GalleryImageVersionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryName = Utils.getValueFromIdByName(innerObject.id(), "galleries"); + this.galleryImageName = Utils.getValueFromIdByName(innerObject.id(), "images"); + this.galleryImageVersionName = Utils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public GalleryImageVersion refresh() { + ReplicationStatusTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .getWithResponse( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + localExpand, + Context.NONE) + .getValue(); + return this; + } + + public GalleryImageVersion refresh(Context context) { + ReplicationStatusTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleryImageVersions() + .getWithResponse( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, localExpand, context) + .getValue(); + return this; + } + + public GalleryImageVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryImageVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryImageVersionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGalleryImageVersion.withTags(tags); + return this; + } + } + + public GalleryImageVersionImpl withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { + if (isInCreateMode()) { + this.innerModel().withPublishingProfile(publishingProfile); + return this; + } else { + this.updateGalleryImageVersion.withPublishingProfile(publishingProfile); + return this; + } + } + + public GalleryImageVersionImpl withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + if (isInCreateMode()) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } else { + this.updateGalleryImageVersion.withStorageProfile(storageProfile); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java new file mode 100644 index 0000000000000..5532fb8c27191 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsClientImpl.java @@ -0,0 +1,1790 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionList; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionUpdate; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +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 GalleryImageVersionsClient. */ +public final class GalleryImageVersionsClientImpl implements GalleryImageVersionsClient { + private final ClientLogger logger = new ClientLogger(GalleryImageVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GalleryImageVersionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryImageVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryImageVersionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(GalleryImageVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryImageVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GalleryImageVersionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImageVersionInner galleryImageVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImageVersionUpdate galleryImageVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @QueryParam("$expand") ReplicationStatusTypes expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryImage( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryImageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImageVersionInner.class, + GalleryImageVersionInner.class, + Context.NONE); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImageVersionInner.class, + GalleryImageVersionInner.class, + context); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .getSyncPoller(); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .getSyncPoller(); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + return createOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .block(); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return createOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .block(); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + accept, + context); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageVersionInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImageVersionInner.class, + GalleryImageVersionInner.class, + Context.NONE); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageVersionInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GalleryImageVersionInner.class, + GalleryImageVersionInner.class, + context); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + return beginUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .getSyncPoller(); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return beginUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .getSyncPoller(); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + return beginUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return beginUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + return updateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .block(); + } + + /** + * Update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery image version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Parameters supplied to the update gallery image version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return updateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .block(); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + expand, + apiVersion, + accept, + context); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + final ReplicationStatusTypes expand = null; + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner get( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + final ReplicationStatusTypes expand = null; + return getAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).block(); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, context) + .block(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + accept, + context); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + .getSyncPoller(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) + .getSyncPoller(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryImageName, String galleryImageVersionName) { + deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).block(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context).block(); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryImageSinglePageAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGalleryImage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + 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 gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryImageSinglePageAsync( + String resourceGroupName, String galleryName, String galleryImageName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGalleryImage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryImageAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + return new PagedFlux<>( + () -> listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName), + nextLink -> listByGalleryImageNextSinglePageAsync(nextLink)); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryImageAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return new PagedFlux<>( + () -> listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName, context), + nextLink -> listByGalleryImageNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName) { + return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName)); + } + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryImageNextSinglePageAsync(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.listByGalleryImageNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryImageNextSinglePageAsync( + 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 + .listByGalleryImageNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java new file mode 100644 index 0000000000000..448b84a83bf7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImageVersionsImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.GalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.GalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GalleryImageVersionsImpl implements GalleryImageVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionsImpl.class); + + private final GalleryImageVersionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GalleryImageVersionsImpl( + GalleryImageVersionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GalleryImageVersion get( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + GalleryImageVersionInner inner = + this.serviceClient().get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); + if (inner != null) { + return new GalleryImageVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImageVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); + } + + public void delete( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); + } + + public PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName) { + PagedIterable inner = + this.serviceClient().listByGalleryImage(resourceGroupName, galleryName, galleryImageName); + return Utils.mapPage(inner, inner1 -> new GalleryImageVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + PagedIterable inner = + this.serviceClient().listByGalleryImage(resourceGroupName, galleryName, galleryImageName, context); + return Utils.mapPage(inner, inner1 -> new GalleryImageVersionImpl(inner1, this.manager())); + } + + public GalleryImageVersion 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + String galleryImageVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryImageVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + ReplicationStatusTypes localExpand = null; + return this + .getWithResponse( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, ReplicationStatusTypes expand, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + String galleryImageVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryImageVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this + .getWithResponse( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + String galleryImageVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryImageVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + String galleryImageVersionName = Utils.getValueFromIdByName(id, "versions"); + if (galleryImageVersionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); + } + + private GalleryImageVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public GalleryImageVersionImpl define(String name) { + return new GalleryImageVersionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java new file mode 100644 index 0000000000000..38caa84972451 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesClientImpl.java @@ -0,0 +1,1490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.GalleryImageList; +import com.azure.resourcemanager.compute.generated.models.GalleryImageUpdate; +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 GalleryImagesClient. */ +public final class GalleryImagesClientImpl implements GalleryImagesClient { + private final ClientLogger logger = new ClientLogger(GalleryImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GalleryImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryImagesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(GalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryImages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GalleryImagesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImageInner galleryImage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GalleryImageUpdate galleryImage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images/{galleryImageName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/images") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGallery( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, Context.NONE); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, context); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).getSyncPoller(); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .getSyncPoller(); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner createOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); + } + + /** + * Create or update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery image definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + accept, + context); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageInner> beginUpdateAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, Context.NONE); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GalleryImageInner> beginUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class, context); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).getSyncPoller(); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GalleryImageInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .getSyncPoller(); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner update( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); + } + + /** + * Update a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery image definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Parameters supplied to the update gallery image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { + return getAsync(resourceGroupName, galleryName, galleryImageName).block(); + } + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context).block(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + accept, + context); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName).getSyncPoller(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context).getSyncPoller(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryImageName) { + deleteAsync(resourceGroupName, galleryName, galleryImageName).block(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryImageName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryImageName, context).block(); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync( + String resourceGroupName, String galleryName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + 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 gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync( + String resourceGroupName, String galleryName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGallery( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName) { + return new PagedFlux<>( + () -> listByGallerySinglePageAsync(resourceGroupName, galleryName), + nextLink -> listByGalleryNextSinglePageAsync(nextLink)); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryAsync( + String resourceGroupName, String galleryName, Context context) { + return new PagedFlux<>( + () -> listByGallerySinglePageAsync(resourceGroupName, galleryName, context), + nextLink -> listByGalleryNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery(String resourceGroupName, String galleryName) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); + } + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery( + String resourceGroupName, String galleryName, Context context) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(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.listByGalleryNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(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 + .listByGalleryNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java new file mode 100644 index 0000000000000..4906bb11b30ab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImagesImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.GalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.GalleryImage; +import com.azure.resourcemanager.compute.generated.models.GalleryImages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GalleryImagesImpl implements GalleryImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImagesImpl.class); + + private final GalleryImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GalleryImagesImpl( + GalleryImagesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public GalleryImage get(String resourceGroupName, String galleryName, String galleryImageName) { + GalleryImageInner inner = this.serviceClient().get(resourceGroupName, galleryName, galleryImageName); + if (inner != null) { + return new GalleryImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, galleryName, galleryImageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String galleryName, String galleryImageName) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryImageName); + } + + public void delete(String resourceGroupName, String galleryName, String galleryImageName, Context context) { + this.serviceClient().delete(resourceGroupName, galleryName, galleryImageName, context); + } + + public PagedIterable listByGallery(String resourceGroupName, String galleryName) { + PagedIterable inner = this.serviceClient().listByGallery(resourceGroupName, galleryName); + return Utils.mapPage(inner, inner1 -> new GalleryImageImpl(inner1, this.manager())); + } + + public PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context) { + PagedIterable inner = + this.serviceClient().listByGallery(resourceGroupName, galleryName, context); + return Utils.mapPage(inner, inner1 -> new GalleryImageImpl(inner1, this.manager())); + } + + public GalleryImage 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + return this.getWithResponse(resourceGroupName, galleryName, galleryImageName, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + return this.getWithResponse(resourceGroupName, galleryName, galleryImageName, 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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryImageName, Context.NONE); + } + + public void deleteByIdWithResponse(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 galleryName = Utils.getValueFromIdByName(id, "galleries"); + if (galleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'galleries'.", id))); + } + String galleryImageName = Utils.getValueFromIdByName(id, "images"); + if (galleryImageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + this.delete(resourceGroupName, galleryName, galleryImageName, context); + } + + private GalleryImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public GalleryImageImpl define(String name) { + return new GalleryImageImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java new file mode 100644 index 0000000000000..c01fbcf8e8e66 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GalleryImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner; +import com.azure.resourcemanager.compute.generated.models.Gallery; +import com.azure.resourcemanager.compute.generated.models.GalleryIdentifier; +import com.azure.resourcemanager.compute.generated.models.GalleryPropertiesProvisioningState; +import com.azure.resourcemanager.compute.generated.models.GalleryUpdate; +import com.azure.resourcemanager.compute.generated.models.SelectPermissions; +import com.azure.resourcemanager.compute.generated.models.SharingProfile; +import java.util.Collections; +import java.util.Map; + +public final class GalleryImpl implements Gallery, Gallery.Definition, Gallery.Update { + private GalleryInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String description() { + return this.innerModel().description(); + } + + public GalleryIdentifier identifier() { + return this.innerModel().identifier(); + } + + public GalleryPropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SharingProfile sharingProfile() { + return this.innerModel().sharingProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GalleryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String galleryName; + + private GalleryUpdate updateGallery; + + public GalleryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Gallery create() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .createOrUpdate(resourceGroupName, galleryName, this.innerModel(), Context.NONE); + return this; + } + + public Gallery create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .createOrUpdate(resourceGroupName, galleryName, this.innerModel(), context); + return this; + } + + GalleryImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new GalleryInner(); + this.serviceManager = serviceManager; + this.galleryName = name; + } + + public GalleryImpl update() { + this.updateGallery = new GalleryUpdate(); + return this; + } + + public Gallery apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .update(resourceGroupName, galleryName, updateGallery, Context.NONE); + return this; + } + + public Gallery apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .update(resourceGroupName, galleryName, updateGallery, context); + return this; + } + + GalleryImpl(GalleryInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.galleryName = Utils.getValueFromIdByName(innerObject.id(), "galleries"); + } + + public Gallery refresh() { + SelectPermissions localSelect = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, Context.NONE) + .getValue(); + return this; + } + + public Gallery refresh(Context context) { + SelectPermissions localSelect = null; + this.innerObject = + serviceManager + .serviceClient() + .getGalleries() + .getByResourceGroupWithResponse(resourceGroupName, galleryName, localSelect, context) + .getValue(); + return this; + } + + public GalleryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GalleryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GalleryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateGallery.withTags(tags); + return this; + } + } + + public GalleryImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateGallery.withDescription(description); + return this; + } + } + + public GalleryImpl withIdentifier(GalleryIdentifier identifier) { + if (isInCreateMode()) { + this.innerModel().withIdentifier(identifier); + return this; + } else { + this.updateGallery.withIdentifier(identifier); + return this; + } + } + + public GalleryImpl withSharingProfile(SharingProfile sharingProfile) { + if (isInCreateMode()) { + this.innerModel().withSharingProfile(sharingProfile); + return this; + } else { + this.updateGallery.withSharingProfile(sharingProfile); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java new file mode 100644 index 0000000000000..1acb2068e0f3f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesClientImpl.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.GallerySharingProfilesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 GallerySharingProfilesClient. */ +public final class GallerySharingProfilesClientImpl implements GallerySharingProfilesClient { + private final ClientLogger logger = new ClientLogger(GallerySharingProfilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GallerySharingProfilesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GallerySharingProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GallerySharingProfilesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(GallerySharingProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGallerySharingProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface GallerySharingProfilesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" + + "/{galleryName}/share") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("galleryName") String galleryName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharingUpdateInner sharingUpdate, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (sharingUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter sharingUpdate is required and cannot be null.")); + } else { + sharingUpdate.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + sharingUpdate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (sharingUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter sharingUpdate is required and cannot be null.")); + } else { + sharingUpdate.validate(); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + sharingUpdate, + accept, + context); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SharingUpdateInner> beginUpdateAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, sharingUpdate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SharingUpdateInner.class, SharingUpdateInner.class, Context.NONE); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SharingUpdateInner> beginUpdateAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, sharingUpdate, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SharingUpdateInner.class, SharingUpdateInner.class, context); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + return beginUpdateAsync(resourceGroupName, galleryName, sharingUpdate).getSyncPoller(); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SharingUpdateInner> beginUpdate( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, sharingUpdate, context).getSyncPoller(); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + return beginUpdateAsync(resourceGroupName, galleryName, sharingUpdate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, sharingUpdate, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharingUpdateInner update(String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + return updateAsync(resourceGroupName, galleryName, sharingUpdate).block(); + } + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharingUpdateInner update( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + return updateAsync(resourceGroupName, galleryName, sharingUpdate, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.java new file mode 100644 index 0000000000000..125fdc121add6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/GallerySharingProfilesImpl.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.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.GallerySharingProfilesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import com.azure.resourcemanager.compute.generated.models.GallerySharingProfiles; +import com.azure.resourcemanager.compute.generated.models.SharingUpdate; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GallerySharingProfilesImpl implements GallerySharingProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GallerySharingProfilesImpl.class); + + private final GallerySharingProfilesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public GallerySharingProfilesImpl( + GallerySharingProfilesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SharingUpdate update(String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate) { + SharingUpdateInner inner = this.serviceClient().update(resourceGroupName, galleryName, sharingUpdate); + if (inner != null) { + return new SharingUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public SharingUpdate update( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context) { + SharingUpdateInner inner = this.serviceClient().update(resourceGroupName, galleryName, sharingUpdate, context); + if (inner != null) { + return new SharingUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + private GallerySharingProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java new file mode 100644 index 0000000000000..f598c2c82fc88 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImageImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.Image; +import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile; +import com.azure.resourcemanager.compute.generated.models.ImageUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ImageImpl implements Image, Image.Definition, Image.Update { + private ImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SubResource sourceVirtualMachine() { + return this.innerModel().sourceVirtualMachine(); + } + + public ImageStorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public HyperVGenerationTypes hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String imageName; + + private ImageUpdate updateParameters; + + public ImageImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Image create() { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .createOrUpdate(resourceGroupName, imageName, this.innerModel(), Context.NONE); + return this; + } + + public Image create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .createOrUpdate(resourceGroupName, imageName, this.innerModel(), context); + return this; + } + + ImageImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new ImageInner(); + this.serviceManager = serviceManager; + this.imageName = name; + } + + public ImageImpl update() { + this.updateParameters = new ImageUpdate(); + return this; + } + + public Image apply() { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .update(resourceGroupName, imageName, updateParameters, Context.NONE); + return this; + } + + public Image apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getImages().update(resourceGroupName, imageName, updateParameters, context); + return this; + } + + ImageImpl(ImageInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.imageName = Utils.getValueFromIdByName(innerObject.id(), "images"); + } + + public Image refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .getByResourceGroupWithResponse(resourceGroupName, imageName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public Image refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .getByResourceGroupWithResponse(resourceGroupName, imageName, localExpand, context) + .getValue(); + return this; + } + + public ImageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ImageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ImageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ImageImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ImageImpl withSourceVirtualMachine(SubResource sourceVirtualMachine) { + if (isInCreateMode()) { + this.innerModel().withSourceVirtualMachine(sourceVirtualMachine); + return this; + } else { + this.updateParameters.withSourceVirtualMachine(sourceVirtualMachine); + return this; + } + } + + public ImageImpl withStorageProfile(ImageStorageProfile storageProfile) { + if (isInCreateMode()) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } else { + this.updateParameters.withStorageProfile(storageProfile); + return this; + } + } + + public ImageImpl withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + if (isInCreateMode()) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } else { + this.updateParameters.withHyperVGeneration(hyperVGeneration); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java new file mode 100644 index 0000000000000..0629ca4577e69 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesClientImpl.java @@ -0,0 +1,1551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.ImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import com.azure.resourcemanager.compute.generated.models.ImageListResult; +import com.azure.resourcemanager.compute.generated.models.ImageUpdate; +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 ImagesClient. */ +public final class ImagesClientImpl implements ImagesClient { + private final ClientLogger logger = new ClientLogger(ImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of ImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImagesClientImpl(ComputeManagementClientImpl client) { + this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientImages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface ImagesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" + + "/{imageName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("imageName") String imageName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ImageInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" + + "/{imageName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("imageName") String imageName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ImageUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" + + "/{imageName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("imageName") String imageName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" + + "/{imageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("imageName") String imageName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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"}) + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String imageName, ImageInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImageInner> beginCreateOrUpdateAsync( + String resourceGroupName, String imageName, ImageInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, Context.NONE); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImageInner> beginCreateOrUpdateAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, context); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters).getSyncPoller(); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context).getSyncPoller(); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner createOrUpdate(String resourceGroupName, String imageName, ImageInner parameters) { + return createOrUpdateAsync(resourceGroupName, imageName, parameters).block(); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Create Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner createOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, imageName, parameters, context).block(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String imageName, ImageUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImageInner> beginUpdateAsync( + String resourceGroupName, String imageName, ImageUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, imageName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, Context.NONE); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ImageInner> beginUpdateAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, imageName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, context); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateAsync(resourceGroupName, imageName, parameters).getSyncPoller(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, imageName, parameters, context).getSyncPoller(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateAsync(resourceGroupName, imageName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, imageName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters) { + return updateAsync(resourceGroupName, imageName, parameters).block(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return updateAsync(resourceGroupName, imageName, parameters, context).block(); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String imageName) { + 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 (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String imageName, 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 (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String imageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName) { + return beginDeleteAsync(resourceGroupName, imageName).getSyncPoller(); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String imageName, Context context) { + return beginDeleteAsync(resourceGroupName, imageName, context).getSyncPoller(); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String imageName) { + return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String imageName, Context context) { + return beginDeleteAsync(resourceGroupName, imageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 imageName) { + deleteAsync(resourceGroupName, imageName).block(); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 imageName, Context context) { + deleteAsync(resourceGroupName, imageName, context).block(); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String imageName, String expand) { + 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 (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + imageName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String imageName, String expand, 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 (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + imageName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String imageName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String imageName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner getByResourceGroup(String resourceGroupName, String imageName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, imageName, expand).block(); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand, context).block(); + } + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Gets the list of images under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of images under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of images under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets the list of images under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @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 the List Image operation response. + */ + @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 the List Image operation response. + */ + @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 the List Image operation response. + */ + @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 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 List Image operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.java new file mode 100644 index 0000000000000..d33de68a99534 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ImagesImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.ImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import com.azure.resourcemanager.compute.generated.models.Image; +import com.azure.resourcemanager.compute.generated.models.Images; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ImagesImpl implements Images { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImagesImpl.class); + + private final ImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public ImagesImpl( + ImagesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String imageName) { + this.serviceClient().delete(resourceGroupName, imageName); + } + + public void delete(String resourceGroupName, String imageName, Context context) { + this.serviceClient().delete(resourceGroupName, imageName, context); + } + + public Image getByResourceGroup(String resourceGroupName, String imageName) { + ImageInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, imageName); + if (inner != null) { + return new ImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, imageName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public Image 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 imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + String localExpand = null; + return this.getByResourceGroupWithResponse(resourceGroupName, imageName, localExpand, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, imageName, expand, 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 imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + this.delete(resourceGroupName, imageName, Context.NONE); + } + + public void deleteByIdWithResponse(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 imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + this.delete(resourceGroupName, imageName, context); + } + + private ImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public ImageImpl define(String name) { + return new ImageImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java new file mode 100644 index 0000000000000..be71a87cfcd20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsClientImpl.java @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; +import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput; +import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput; +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 LogAnalyticsClient. */ +public final class LogAnalyticsClientImpl implements LogAnalyticsClient { + private final ClientLogger logger = new ClientLogger(LogAnalyticsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LogAnalyticsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of LogAnalyticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogAnalyticsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientLogAnalytics to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface LogAnalyticsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getRequestRateByInterval") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportRequestRateByInterval( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RequestRateByIntervalInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getThrottledRequests") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportThrottledRequests( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ThrottledRequestsInput parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportRequestRateByIntervalWithResponseAsync( + String location, RequestRateByIntervalInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportRequestRateByInterval( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportRequestRateByIntervalWithResponseAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportRequestRateByInterval( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LogAnalyticsOperationResultInner> + beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { + Mono>> mono = exportRequestRateByIntervalWithResponseAsync(location, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class, + Context.NONE); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LogAnalyticsOperationResultInner> + beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + exportRequestRateByIntervalWithResponseAsync(location, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class, + context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { + return beginExportRequestRateByIntervalAsync(location, parameters).getSyncPoller(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context) { + return beginExportRequestRateByIntervalAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportRequestRateByIntervalAsync( + String location, RequestRateByIntervalInput parameters) { + return beginExportRequestRateByIntervalAsync(location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportRequestRateByIntervalAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + return beginExportRequestRateByIntervalAsync(location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters) { + return exportRequestRateByIntervalAsync(location, parameters).block(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context) { + return exportRequestRateByIntervalAsync(location, parameters, context).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportThrottledRequestsWithResponseAsync( + String location, ThrottledRequestsInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportThrottledRequests( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportThrottledRequestsWithResponseAsync( + String location, ThrottledRequestsInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportThrottledRequests( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LogAnalyticsOperationResultInner> + beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters) { + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class, + Context.NONE); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LogAnalyticsOperationResultInner> + beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class, + context); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) { + return beginExportThrottledRequestsAsync(location, parameters).getSyncPoller(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, ThrottledRequestsInput parameters, Context context) { + return beginExportThrottledRequestsAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportThrottledRequestsAsync( + String location, ThrottledRequestsInput parameters) { + return beginExportThrottledRequestsAsync(location, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportThrottledRequestsAsync( + String location, ThrottledRequestsInput parameters, Context context) { + return beginExportThrottledRequestsAsync(location, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportThrottledRequests( + String location, ThrottledRequestsInput parameters) { + return exportThrottledRequestsAsync(location, parameters).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportThrottledRequests( + String location, ThrottledRequestsInput parameters, Context context) { + return exportThrottledRequestsAsync(location, parameters, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.java new file mode 100644 index 0000000000000..07c0dc9333bd9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.LogAnalyticsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; +import com.azure.resourcemanager.compute.generated.models.LogAnalytics; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOperationResult; +import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput; +import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LogAnalyticsImpl implements LogAnalytics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsImpl.class); + + private final LogAnalyticsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public LogAnalyticsImpl( + LogAnalyticsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LogAnalyticsOperationResult exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters) { + LogAnalyticsOperationResultInner inner = this.serviceClient().exportRequestRateByInterval(location, parameters); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context) { + LogAnalyticsOperationResultInner inner = + this.serviceClient().exportRequestRateByInterval(location, parameters, context); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportThrottledRequests(String location, ThrottledRequestsInput parameters) { + LogAnalyticsOperationResultInner inner = this.serviceClient().exportThrottledRequests(location, parameters); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LogAnalyticsOperationResult exportThrottledRequests( + String location, ThrottledRequestsInput parameters, Context context) { + LogAnalyticsOperationResultInner inner = + this.serviceClient().exportThrottledRequests(location, parameters, context); + if (inner != null) { + return new LogAnalyticsOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private LogAnalyticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java new file mode 100644 index 0000000000000..498f33b546b23 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/LogAnalyticsOperationResultImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOperationResult; +import com.azure.resourcemanager.compute.generated.models.LogAnalyticsOutput; + +public final class LogAnalyticsOperationResultImpl implements LogAnalyticsOperationResult { + private LogAnalyticsOperationResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + LogAnalyticsOperationResultImpl( + LogAnalyticsOperationResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LogAnalyticsOutput properties() { + return this.innerModel().properties(); + } + + public LogAnalyticsOperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.java new file mode 100644 index 0000000000000..f8f51ec56a409 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSFamilyImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.azure.resourcemanager.compute.generated.models.OSFamily; +import com.azure.resourcemanager.compute.generated.models.OSFamilyProperties; + +public final class OSFamilyImpl implements OSFamily { + private OSFamilyInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + OSFamilyImpl(OSFamilyInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 String location() { + return this.innerModel().location(); + } + + public OSFamilyProperties properties() { + return this.innerModel().properties(); + } + + public OSFamilyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.java new file mode 100644 index 0000000000000..fc67b7d79dfb2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OSVersionImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.azure.resourcemanager.compute.generated.models.OSVersion; +import com.azure.resourcemanager.compute.generated.models.OSVersionProperties; + +public final class OSVersionImpl implements OSVersion { + private OSVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + OSVersionImpl( + OSVersionInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 String location() { + return this.innerModel().location(); + } + + public OSVersionProperties properties() { + return this.innerModel().properties(); + } + + public OSVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..9162764b9547f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.OperationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.azure.resourcemanager.compute.generated.models.ComputeOperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Compute/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of compute operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets a list of compute operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of compute operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..af12838fe6832 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.OperationsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.azure.resourcemanager.compute.generated.models.ComputeOperationValue; +import com.azure.resourcemanager.compute.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ComputeOperationValueImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ComputeOperationValueImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..9cd7d390e9898 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.compute.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager 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 PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateLinkResourceListResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..bafdba6162ccd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.compute.generated.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java new file mode 100644 index 0000000000000..c23a0bd8a37da --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupUpdate; +import com.azure.resourcemanager.compute.generated.models.SubResourceWithColocationStatus; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ProximityPlacementGroupImpl + implements ProximityPlacementGroup, ProximityPlacementGroup.Definition, ProximityPlacementGroup.Update { + private ProximityPlacementGroupInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 ProximityPlacementGroupType proximityPlacementGroupType() { + return this.innerModel().proximityPlacementGroupType(); + } + + public List virtualMachines() { + List inner = this.innerModel().virtualMachines(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualMachineScaleSets() { + List inner = this.innerModel().virtualMachineScaleSets(); + 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 InstanceViewStatus colocationStatus() { + return this.innerModel().colocationStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProximityPlacementGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String proximityPlacementGroupName; + + private ProximityPlacementGroupUpdate updateParameters; + + public ProximityPlacementGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ProximityPlacementGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .createOrUpdateWithResponse( + resourceGroupName, proximityPlacementGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProximityPlacementGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .createOrUpdateWithResponse(resourceGroupName, proximityPlacementGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + ProximityPlacementGroupImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new ProximityPlacementGroupInner(); + this.serviceManager = serviceManager; + this.proximityPlacementGroupName = name; + } + + public ProximityPlacementGroupImpl update() { + this.updateParameters = new ProximityPlacementGroupUpdate(); + return this; + } + + public ProximityPlacementGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .updateWithResponse(resourceGroupName, proximityPlacementGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ProximityPlacementGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .updateWithResponse(resourceGroupName, proximityPlacementGroupName, updateParameters, context) + .getValue(); + return this; + } + + ProximityPlacementGroupImpl( + ProximityPlacementGroupInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.proximityPlacementGroupName = Utils.getValueFromIdByName(innerObject.id(), "proximityPlacementGroups"); + } + + public ProximityPlacementGroup refresh() { + String localIncludeColocationStatus = null; + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, localIncludeColocationStatus, Context.NONE) + .getValue(); + return this; + } + + public ProximityPlacementGroup refresh(Context context) { + String localIncludeColocationStatus = null; + this.innerObject = + serviceManager + .serviceClient() + .getProximityPlacementGroups() + .getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, localIncludeColocationStatus, context) + .getValue(); + return this; + } + + public ProximityPlacementGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProximityPlacementGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProximityPlacementGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ProximityPlacementGroupImpl withProximityPlacementGroupType( + ProximityPlacementGroupType proximityPlacementGroupType) { + this.innerModel().withProximityPlacementGroupType(proximityPlacementGroupType); + return this; + } + + public ProximityPlacementGroupImpl withColocationStatus(InstanceViewStatus colocationStatus) { + this.innerModel().withColocationStatus(colocationStatus); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.java new file mode 100644 index 0000000000000..f85041dbd3a65 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsClientImpl.java @@ -0,0 +1,1329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.ProximityPlacementGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupListResult; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProximityPlacementGroupsClient. */ +public final class ProximityPlacementGroupsClientImpl implements ProximityPlacementGroupsClient { + private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProximityPlacementGroupsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of ProximityPlacementGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProximityPlacementGroupsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(ProximityPlacementGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientProximityPlacementGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface ProximityPlacementGroupsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ProximityPlacementGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ProximityPlacementGroupUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/proximityPlacementGroups/{proximityPlacementGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, + @QueryParam("includeColocationStatus") String includeColocationStatus, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/proximityPlacementGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + + @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); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner createOrUpdate( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).block(); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Create Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context) + .block(); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner update( + String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupUpdate parameters) { + return updateAsync(resourceGroupName, proximityPlacementGroupName, parameters).block(); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Parameters supplied to the Update Proximity Placement Group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupUpdate parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context).block(); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String proximityPlacementGroupName) { + 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 (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String proximityPlacementGroupName, 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 (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String proximityPlacementGroupName) { + return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String proximityPlacementGroupName) { + deleteAsync(resourceGroupName, proximityPlacementGroupName).block(); + } + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName, context).block(); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus) { + 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 (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + includeColocationStatus, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, 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 (proximityPlacementGroupName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter proximityPlacementGroupName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + includeColocationStatus, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus) { + return getByResourceGroupWithResponseAsync( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String proximityPlacementGroupName) { + final String includeColocationStatus = null; + return getByResourceGroupWithResponseAsync( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner getByResourceGroup( + String resourceGroupName, String proximityPlacementGroupName) { + final String includeColocationStatus = null; + return getByResourceGroupAsync(resourceGroupName, proximityPlacementGroupName, includeColocationStatus).block(); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context) { + return getByResourceGroupWithResponseAsync( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus, context) + .block(); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Lists all proximity placement groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Proximity Placement Group operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all proximity placement groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all proximity placement groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 the List Proximity Placement Group operation response. + */ + @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 the List Proximity Placement Group operation response. + */ + @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)); + } + + /** + * 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 the List Proximity Placement Group operation response. + */ + @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 the List Proximity Placement Group operation response. + */ + @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)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java new file mode 100644 index 0000000000000..b24abc5c8f882 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ProximityPlacementGroupsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.ProximityPlacementGroupsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup; +import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupsImpl.class); + + private final ProximityPlacementGroupsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public ProximityPlacementGroupsImpl( + ProximityPlacementGroupsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String proximityPlacementGroupName) { + this.serviceClient().delete(resourceGroupName, proximityPlacementGroupName); + } + + public Response deleteWithResponse( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, proximityPlacementGroupName, context); + } + + public ProximityPlacementGroup getByResourceGroup(String resourceGroupName, String proximityPlacementGroupName) { + ProximityPlacementGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, proximityPlacementGroupName); + if (inner != null) { + return new ProximityPlacementGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProximityPlacementGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProximityPlacementGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ProximityPlacementGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ProximityPlacementGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ProximityPlacementGroupImpl(inner1, this.manager())); + } + + public ProximityPlacementGroup 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 proximityPlacementGroupName = Utils.getValueFromIdByName(id, "proximityPlacementGroups"); + if (proximityPlacementGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'proximityPlacementGroups'.", + id))); + } + String localIncludeColocationStatus = null; + return this + .getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, localIncludeColocationStatus, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, String includeColocationStatus, 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 proximityPlacementGroupName = Utils.getValueFromIdByName(id, "proximityPlacementGroups"); + if (proximityPlacementGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'proximityPlacementGroups'.", + id))); + } + return this + .getByResourceGroupWithResponse( + resourceGroupName, proximityPlacementGroupName, includeColocationStatus, 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 proximityPlacementGroupName = Utils.getValueFromIdByName(id, "proximityPlacementGroups"); + if (proximityPlacementGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'proximityPlacementGroups'.", + id))); + } + this.deleteWithResponse(resourceGroupName, proximityPlacementGroupName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(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 proximityPlacementGroupName = Utils.getValueFromIdByName(id, "proximityPlacementGroups"); + if (proximityPlacementGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'proximityPlacementGroups'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, proximityPlacementGroupName, context); + } + + private ProximityPlacementGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public ProximityPlacementGroupImpl define(String name) { + return new ProximityPlacementGroupImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RecoveryWalkResponseImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RecoveryWalkResponseImpl.java new file mode 100644 index 0000000000000..4b9d04c8653d6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RecoveryWalkResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.models.RecoveryWalkResponse; + +public final class RecoveryWalkResponseImpl implements RecoveryWalkResponse { + private RecoveryWalkResponseInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RecoveryWalkResponseImpl( + RecoveryWalkResponseInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean walkPerformed() { + return this.innerModel().walkPerformed(); + } + + public Integer nextPlatformUpdateDomain() { + return this.innerModel().nextPlatformUpdateDomain(); + } + + public RecoveryWalkResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkuImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..b699f8fd9ff57 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkuImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.compute.generated.models.ResourceSku; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCapacity; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuCosts; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.compute.generated.models.ResourceSkuRestrictions; +import java.util.Collections; +import java.util.List; + +public final class ResourceSkuImpl implements ResourceSku { + private ResourceSkuInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + ResourceSkuImpl( + ResourceSkuInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ResourceSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List apiVersions() { + List inner = this.innerModel().apiVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java new file mode 100644 index 0000000000000..23eeb6cda036d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusClientImpl.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.ResourceSkusClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.compute.generated.models.ResourceSkusResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ +public final class ResourceSkusClientImpl implements ResourceSkusClient { + private final ClientLogger logger = new ClientLogger(ResourceSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceSkusService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of ResourceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceSkusClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(ResourceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientResourceSkus to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface ResourceSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @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); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + 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 apiVersion = "2019-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, 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 apiVersion = "2019-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, 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 the List Resource Skus operation response. + */ + @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 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 List Resource Skus operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.java new file mode 100644 index 0000000000000..47a070aae32ea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ResourceSkusImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.ResourceSkusClient; +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.compute.generated.models.ResourceSku; +import com.azure.resourcemanager.compute.generated.models.ResourceSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceSkusImpl implements ResourceSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusImpl.class); + + private final ResourceSkusClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public ResourceSkusImpl( + ResourceSkusClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + private ResourceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java new file mode 100644 index 0000000000000..77e46fccfb51b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RestorePointCollectionImpl + implements RestorePointCollection, RestorePointCollection.Definition, RestorePointCollection.Update { + private RestorePointCollectionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 RestorePointCollectionSourceProperties source() { + return this.innerModel().source(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String restorePointCollectionId() { + return this.innerModel().restorePointCollectionId(); + } + + public List restorePoints() { + List inner = this.innerModel().restorePoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RestorePointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RestorePointCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String restorePointCollectionName; + + private RestorePointCollectionUpdate updateParameters; + + public RestorePointCollectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RestorePointCollection create() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .createOrUpdateWithResponse( + resourceGroupName, restorePointCollectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .createOrUpdateWithResponse(resourceGroupName, restorePointCollectionName, this.innerModel(), context) + .getValue(); + return this; + } + + RestorePointCollectionImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new RestorePointCollectionInner(); + this.serviceManager = serviceManager; + this.restorePointCollectionName = name; + } + + public RestorePointCollectionImpl update() { + this.updateParameters = new RestorePointCollectionUpdate(); + return this; + } + + public RestorePointCollection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .updateWithResponse(resourceGroupName, restorePointCollectionName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .updateWithResponse(resourceGroupName, restorePointCollectionName, updateParameters, context) + .getValue(); + return this; + } + + RestorePointCollectionImpl( + RestorePointCollectionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.restorePointCollectionName = Utils.getValueFromIdByName(innerObject.id(), "restorePointCollections"); + } + + public RestorePointCollection refresh() { + RestorePointCollectionExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .getByResourceGroupWithResponse( + resourceGroupName, restorePointCollectionName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public RestorePointCollection refresh(Context context) { + RestorePointCollectionExpandOptions localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getRestorePointCollections() + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, localExpand, context) + .getValue(); + return this; + } + + public RestorePointCollectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RestorePointCollectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RestorePointCollectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public RestorePointCollectionImpl withSource(RestorePointCollectionSourceProperties source) { + if (isInCreateMode()) { + this.innerModel().withSource(source); + return this; + } else { + this.updateParameters.withSource(source); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java new file mode 100644 index 0000000000000..82f7885b143c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsClientImpl.java @@ -0,0 +1,1454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionListResult; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionUpdate; +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 RestorePointCollectionsClient. */ +public final class RestorePointCollectionsClientImpl implements RestorePointCollectionsClient { + private final ClientLogger logger = new ClientLogger(RestorePointCollectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RestorePointCollectionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of RestorePointCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestorePointCollectionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(RestorePointCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientRestorePointCollections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface RestorePointCollectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointCollectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointCollectionUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @QueryParam("$expand") RestorePointCollectionExpandOptions expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.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.Compute/restorePointCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + 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"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner createOrUpdate( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, restorePointCollectionName, parameters).block(); + } + + /** + * The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for + * more details. When updating a restore point collection, only tags may be modified. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Create or Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters, context) + .block(); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner update( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionUpdate parameters) { + return updateAsync(resourceGroupName, restorePointCollectionName, parameters).block(); + } + + /** + * The operation to update the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param parameters Parameters supplied to the Update restore point collection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionUpdate parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, restorePointCollectionName, parameters, context).block(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + apiVersion, + accept, + context); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, restorePointCollectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String restorePointCollectionName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName).getSyncPoller(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, context).getSyncPoller(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String restorePointCollectionName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String restorePointCollectionName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 restorePointCollectionName) { + deleteAsync(resourceGroupName, restorePointCollectionName).block(); + } + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 restorePointCollectionName, Context context) { + deleteAsync(resourceGroupName, restorePointCollectionName, context).block(); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionExpandOptions expand) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + expand, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + expand, + apiVersion, + accept, + context); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String restorePointCollectionName, RestorePointCollectionExpandOptions expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, restorePointCollectionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String restorePointCollectionName) { + final RestorePointCollectionExpandOptions expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, restorePointCollectionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointCollectionInner getByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + final RestorePointCollectionExpandOptions expand = null; + return getByResourceGroupAsync(resourceGroupName, restorePointCollectionName, expand).block(); + } + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, restorePointCollectionName, expand, context) + .block(); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of restore point collections 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of restore point collections 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets the list of restore point collections 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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response. + */ + @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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List restore point collection operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java new file mode 100644 index 0000000000000..df2ec9da93d29 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointCollectionsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.RestorePointCollectionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollection; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionExpandOptions; +import com.azure.resourcemanager.compute.generated.models.RestorePointCollections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RestorePointCollectionsImpl implements RestorePointCollections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointCollectionsImpl.class); + + private final RestorePointCollectionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public RestorePointCollectionsImpl( + RestorePointCollectionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName); + } + + public void delete(String resourceGroupName, String restorePointCollectionName, Context context) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, context); + } + + public RestorePointCollection getByResourceGroup(String resourceGroupName, String restorePointCollectionName) { + RestorePointCollectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, restorePointCollectionName); + if (inner != null) { + return new RestorePointCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorePointCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RestorePointCollectionImpl(inner1, this.manager())); + } + + public RestorePointCollection 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + RestorePointCollectionExpandOptions localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, RestorePointCollectionExpandOptions expand, 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, restorePointCollectionName, expand, 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + this.delete(resourceGroupName, restorePointCollectionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + this.delete(resourceGroupName, restorePointCollectionName, context); + } + + private RestorePointCollectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public RestorePointCollectionImpl define(String name) { + return new RestorePointCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java new file mode 100644 index 0000000000000..e2cb091ab7414 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiEntityReference; +import com.azure.resourcemanager.compute.generated.models.ConsistencyModeTypes; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePointProvisioningDetails; +import com.azure.resourcemanager.compute.generated.models.RestorePointSourceMetadata; +import java.util.Collections; +import java.util.List; + +public final class RestorePointImpl implements RestorePoint, RestorePoint.Definition { + private RestorePointInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RestorePointImpl( + RestorePointInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 List excludeDisks() { + List inner = this.innerModel().excludeDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RestorePointSourceMetadata sourceMetadata() { + return this.innerModel().sourceMetadata(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConsistencyModeTypes consistencyMode() { + return this.innerModel().consistencyMode(); + } + + public RestorePointProvisioningDetails provisioningDetails() { + return this.innerModel().provisioningDetails(); + } + + public RestorePointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String restorePointCollectionName; + + private String restorePointName; + + public RestorePointImpl withExistingRestorePointCollection( + String resourceGroupName, String restorePointCollectionName) { + this.resourceGroupName = resourceGroupName; + this.restorePointCollectionName = restorePointCollectionName; + return this; + } + + public RestorePoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .create( + resourceGroupName, restorePointCollectionName, restorePointName, this.innerModel(), Context.NONE); + return this; + } + + public RestorePoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .create(resourceGroupName, restorePointCollectionName, restorePointName, this.innerModel(), context); + return this; + } + + RestorePointImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new RestorePointInner(); + this.serviceManager = serviceManager; + this.restorePointName = name; + } + + public RestorePoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, Context.NONE) + .getValue(); + return this; + } + + public RestorePoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRestorePoints() + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, context) + .getValue(); + return this; + } + + public RestorePointImpl withExcludeDisks(List excludeDisks) { + this.innerModel().withExcludeDisks(excludeDisks); + return this; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java new file mode 100644 index 0000000000000..127e35c092b32 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsClientImpl.java @@ -0,0 +1,882 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +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 RestorePointsClient. */ +public final class RestorePointsClientImpl implements RestorePointsClient { + private final ClientLogger logger = new ClientLogger(RestorePointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RestorePointsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of RestorePointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestorePointsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(RestorePointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientRestorePoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface RestorePointsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RestorePointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("restorePointCollectionName") String restorePointCollectionName, + @PathParam("restorePointName") String restorePointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + parameters, + accept, + context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RestorePointInner.class, RestorePointInner.class, Context.NONE); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, restorePointCollectionName, restorePointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RestorePointInner.class, RestorePointInner.class, context); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters) + .getSyncPoller(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .getSyncPoller(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters) { + return createAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters).block(); + } + + /** + * The operation to create the restore point. Updating properties of an existing restore point is not allowed. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param parameters Parameters supplied to the Create restore point operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String restorePointCollectionName, + String restorePointName, + RestorePointInner parameters, + Context context) { + return createAsync(resourceGroupName, restorePointCollectionName, restorePointName, parameters, context) + .block(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).getSyncPoller(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context) + .getSyncPoller(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + return beginDeleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 restorePointCollectionName, String restorePointName) { + deleteAsync(resourceGroupName, restorePointCollectionName, restorePointName).block(); + } + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 restorePointCollectionName, String restorePointName, Context context) { + deleteAsync(resourceGroupName, restorePointCollectionName, restorePointName, context).block(); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName, 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 (restorePointCollectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorePointCollectionName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + restorePointName, + apiVersion, + accept, + context); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return getWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner get(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + return getAsync(resourceGroupName, restorePointCollectionName, restorePointName).block(); + } + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + return getWithResponseAsync(resourceGroupName, restorePointCollectionName, restorePointName, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java new file mode 100644 index 0000000000000..400e71f9034b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RestorePointsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.RestorePointsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.azure.resourcemanager.compute.generated.models.RestorePoint; +import com.azure.resourcemanager.compute.generated.models.RestorePoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RestorePointsImpl implements RestorePoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointsImpl.class); + + private final RestorePointsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public RestorePointsImpl( + RestorePointsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, restorePointName); + } + + public void delete( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + this.serviceClient().delete(resourceGroupName, restorePointCollectionName, restorePointName, context); + } + + public RestorePoint get(String resourceGroupName, String restorePointCollectionName, String restorePointName) { + RestorePointInner inner = + this.serviceClient().get(resourceGroupName, restorePointCollectionName, restorePointName); + if (inner != null) { + return new RestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorePointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RestorePoint 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + return this + .getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + return this.getWithResponse(resourceGroupName, restorePointCollectionName, restorePointName, 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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + this.delete(resourceGroupName, restorePointCollectionName, restorePointName, Context.NONE); + } + + public void deleteByIdWithResponse(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 restorePointCollectionName = Utils.getValueFromIdByName(id, "restorePointCollections"); + if (restorePointCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'restorePointCollections'.", + id))); + } + String restorePointName = Utils.getValueFromIdByName(id, "restorePoints"); + if (restorePointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'restorePoints'.", id))); + } + this.delete(resourceGroupName, restorePointCollectionName, restorePointName, context); + } + + private RestorePointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public RestorePointImpl define(String name) { + return new RestorePointImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java new file mode 100644 index 0000000000000..92ae008e28534 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RetrieveBootDiagnosticsDataResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; + +public final class RetrieveBootDiagnosticsDataResultImpl implements RetrieveBootDiagnosticsDataResult { + private RetrieveBootDiagnosticsDataResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RetrieveBootDiagnosticsDataResultImpl( + RetrieveBootDiagnosticsDataResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String consoleScreenshotBlobUri() { + return this.innerModel().consoleScreenshotBlobUri(); + } + + public String serialConsoleLogBlobUri() { + return this.innerModel().serialConsoleLogBlobUri(); + } + + public RetrieveBootDiagnosticsDataResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java new file mode 100644 index 0000000000000..7162bf34c51f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; +import com.azure.resourcemanager.compute.generated.models.InstanceSku; +import com.azure.resourcemanager.compute.generated.models.RoleInstance; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceProperties; +import java.util.Collections; +import java.util.Map; + +public final class RoleInstanceImpl implements RoleInstance { + private RoleInstanceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstanceImpl( + RoleInstanceInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager 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 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 InstanceSku sku() { + return this.innerModel().sku(); + } + + public RoleInstanceProperties properties() { + RoleInstancePropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new RoleInstancePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java new file mode 100644 index 0000000000000..01cae7f0c0c0e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstancePropertiesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceNetworkProfile; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceProperties; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; + +public final class RoleInstancePropertiesImpl implements RoleInstanceProperties { + private RoleInstancePropertiesInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstancePropertiesImpl( + RoleInstancePropertiesInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public RoleInstanceNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public RoleInstanceView instanceView() { + RoleInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new RoleInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleInstancePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java new file mode 100644 index 0000000000000..8fb1b043a1576 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RoleInstanceViewImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ResourceInstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.RoleInstanceView; +import java.util.Collections; +import java.util.List; + +public final class RoleInstanceViewImpl implements RoleInstanceView { + private RoleInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RoleInstanceViewImpl( + RoleInstanceViewInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer platformUpdateDomain() { + return this.innerModel().platformUpdateDomain(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public String privateId() { + return this.innerModel().privateId(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RoleInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java new file mode 100644 index 0000000000000..0a5d024c3b198 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RollingUpgradeStatusInfoImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeProgressInfo; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeRunningStatus; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeStatusInfo; +import java.util.Collections; +import java.util.Map; + +public final class RollingUpgradeStatusInfoImpl implements RollingUpgradeStatusInfo { + private RollingUpgradeStatusInfoInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RollingUpgradeStatusInfoImpl( + RollingUpgradeStatusInfoInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager 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 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 RollingUpgradePolicy policy() { + return this.innerModel().policy(); + } + + public RollingUpgradeRunningStatus runningStatus() { + return this.innerModel().runningStatus(); + } + + public RollingUpgradeProgressInfo progress() { + return this.innerModel().progress(); + } + + public ApiError error() { + return this.innerModel().error(); + } + + public RollingUpgradeStatusInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.java new file mode 100644 index 0000000000000..8891dcb14b696 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentBaseImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocumentBase; + +public final class RunCommandDocumentBaseImpl implements RunCommandDocumentBase { + private RunCommandDocumentBaseInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandDocumentBaseImpl( + RunCommandDocumentBaseInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String schema() { + return this.innerModel().schema(); + } + + public String id() { + return this.innerModel().id(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public String label() { + return this.innerModel().label(); + } + + public String description() { + return this.innerModel().description(); + } + + public RunCommandDocumentBaseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java new file mode 100644 index 0000000000000..c174d60199592 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandDocumentImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocument; +import com.azure.resourcemanager.compute.generated.models.RunCommandParameterDefinition; +import java.util.Collections; +import java.util.List; + +public final class RunCommandDocumentImpl implements RunCommandDocument { + private RunCommandDocumentInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandDocumentImpl( + RunCommandDocumentInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String schema() { + return this.innerModel().schema(); + } + + public String id() { + return this.innerModel().id(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public String label() { + return this.innerModel().label(); + } + + public String description() { + return this.innerModel().description(); + } + + public List script() { + List inner = this.innerModel().script(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RunCommandDocumentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java new file mode 100644 index 0000000000000..4afb8aa9655f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/RunCommandResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import java.util.Collections; +import java.util.List; + +public final class RunCommandResultImpl implements RunCommandResult { + private RunCommandResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + RunCommandResultImpl( + RunCommandResultInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RunCommandResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java new file mode 100644 index 0000000000000..cd64fe5ffc221 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesClientImpl.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryList; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SharedGalleriesClient. */ +public final class SharedGalleriesClientImpl implements SharedGalleriesClient { + private final ClientLogger logger = new ClientLogger(SharedGalleriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharedGalleriesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of SharedGalleriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharedGalleriesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(SharedGalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientSharedGalleries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface SharedGalleriesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @QueryParam("sharedTo") SharedToValues sharedTo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" + + "/{galleryUniqueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("galleryUniqueName") String galleryUniqueName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, SharedToValues sharedTo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + sharedTo, + 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 shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, SharedToValues sharedTo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + sharedTo, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, SharedToValues sharedTo) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, sharedTo), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + final SharedToValues sharedTo = null; + return new PagedFlux<>( + () -> listSinglePageAsync(location, sharedTo), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, SharedToValues sharedTo, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, sharedTo, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + final SharedToValues sharedTo = null; + return new PagedIterable<>(listAsync(location, sharedTo)); + } + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, SharedToValues sharedTo, Context context) { + return new PagedIterable<>(listAsync(location, sharedTo, context)); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String galleryUniqueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + galleryUniqueName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String galleryUniqueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + galleryUniqueName, + apiVersion, + accept, + context); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String galleryUniqueName) { + return getWithResponseAsync(location, galleryUniqueName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryInner get(String location, String galleryUniqueName) { + return getAsync(location, galleryUniqueName).block(); + } + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String galleryUniqueName, Context context) { + return getWithResponseAsync(location, galleryUniqueName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.java new file mode 100644 index 0000000000000..eb310b96c9282 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleriesImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.compute.generated.models.SharedGalleries; +import com.azure.resourcemanager.compute.generated.models.SharedGallery; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharedGalleriesImpl implements SharedGalleries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleriesImpl.class); + + private final SharedGalleriesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public SharedGalleriesImpl( + SharedGalleriesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, SharedToValues sharedTo, Context context) { + PagedIterable inner = this.serviceClient().list(location, sharedTo, context); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImpl(inner1, this.manager())); + } + + public SharedGallery get(String location, String galleryUniqueName) { + SharedGalleryInner inner = this.serviceClient().get(location, galleryUniqueName); + if (inner != null) { + return new SharedGalleryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String location, String galleryUniqueName, Context context) { + Response inner = this.serviceClient().getWithResponse(location, galleryUniqueName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SharedGalleryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SharedGalleriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java new file mode 100644 index 0000000000000..9ad7e3bdc84f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.Disallowed; +import com.azure.resourcemanager.compute.generated.models.GalleryImageFeature; +import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.ImagePurchasePlan; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.RecommendedMachineConfiguration; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImage; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class SharedGalleryImageImpl implements SharedGalleryImage { + private SharedGalleryImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + SharedGalleryImageImpl( + SharedGalleryImageInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public OperatingSystemStateTypes osState() { + return this.innerModel().osState(); + } + + public OffsetDateTime endOfLifeDate() { + return this.innerModel().endOfLifeDate(); + } + + public GalleryImageIdentifier identifier() { + return this.innerModel().identifier(); + } + + public RecommendedMachineConfiguration recommended() { + return this.innerModel().recommended(); + } + + public Disallowed disallowed() { + return this.innerModel().disallowed(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public List features() { + List inner = this.innerModel().features(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ImagePurchasePlan purchasePlan() { + return this.innerModel().purchasePlan(); + } + + public SharedGalleryImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.java new file mode 100644 index 0000000000000..8957b7cf5d3be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersion; +import java.time.OffsetDateTime; + +public final class SharedGalleryImageVersionImpl implements SharedGalleryImageVersion { + private SharedGalleryImageVersionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + SharedGalleryImageVersionImpl( + SharedGalleryImageVersionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public OffsetDateTime publishedDate() { + return this.innerModel().publishedDate(); + } + + public OffsetDateTime endOfLifeDate() { + return this.innerModel().endOfLifeDate(); + } + + public SharedGalleryImageVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java new file mode 100644 index 0000000000000..44498e5327a96 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsClientImpl.java @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersionList; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SharedGalleryImageVersionsClient. */ +public final class SharedGalleryImageVersionsClientImpl implements SharedGalleryImageVersionsClient { + private final ClientLogger logger = new ClientLogger(SharedGalleryImageVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharedGalleryImageVersionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of SharedGalleryImageVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharedGalleryImageVersionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + SharedGalleryImageVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientSharedGalleryImageVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface SharedGalleryImageVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" + + "/{galleryUniqueName}/images/{galleryImageName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("galleryUniqueName") String galleryUniqueName, + @PathParam("galleryImageName") String galleryImageName, + @QueryParam("sharedTo") SharedToValues sharedTo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" + + "/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("galleryUniqueName") String galleryUniqueName, + @PathParam("galleryImageName") String galleryImageName, + @PathParam("galleryImageVersionName") String galleryImageVersionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + sharedTo, + 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 shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + sharedTo, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, galleryImageName, sharedTo), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String galleryUniqueName, String galleryImageName) { + final SharedToValues sharedTo = null; + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, galleryImageName, sharedTo), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, galleryImageName, sharedTo, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String galleryUniqueName, String galleryImageName) { + final SharedToValues sharedTo = null; + return new PagedIterable<>(listAsync(location, galleryUniqueName, galleryImageName, sharedTo)); + } + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context) { + return new PagedIterable<>(listAsync(location, galleryUniqueName, galleryImageName, sharedTo, context)); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + galleryImageVersionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + galleryImageVersionName, + accept, + context); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryImageVersionInner get( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName) { + return getAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName).block(); + } + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName, galleryImageVersionName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.java new file mode 100644 index 0000000000000..d606213f05f6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImageVersionsImpl.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.compute.generated.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.compute.generated.fluent.SharedGalleryImageVersionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersion; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersions; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharedGalleryImageVersionsImpl implements SharedGalleryImageVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImageVersionsImpl.class); + + private final SharedGalleryImageVersionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public SharedGalleryImageVersionsImpl( + SharedGalleryImageVersionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String location, String galleryUniqueName, String galleryImageName) { + PagedIterable inner = + this.serviceClient().list(location, galleryUniqueName, galleryImageName); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImageVersionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context) { + PagedIterable inner = + this.serviceClient().list(location, galleryUniqueName, galleryImageName, sharedTo, context); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImageVersionImpl(inner1, this.manager())); + } + + public SharedGalleryImageVersion get( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName) { + SharedGalleryImageVersionInner inner = + this.serviceClient().get(location, galleryUniqueName, galleryImageName, galleryImageVersionName); + if (inner != null) { + return new SharedGalleryImageVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(location, galleryUniqueName, galleryImageName, galleryImageVersionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SharedGalleryImageVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SharedGalleryImageVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java new file mode 100644 index 0000000000000..a366876459531 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesClientImpl.java @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.SharedGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageList; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SharedGalleryImagesClient. */ +public final class SharedGalleryImagesClientImpl implements SharedGalleryImagesClient { + private final ClientLogger logger = new ClientLogger(SharedGalleryImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharedGalleryImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of SharedGalleryImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharedGalleryImagesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(SharedGalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientSharedGalleryImages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface SharedGalleryImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" + + "/{galleryUniqueName}/images") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("galleryUniqueName") String galleryUniqueName, + @QueryParam("sharedTo") SharedToValues sharedTo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" + + "/{galleryUniqueName}/images/{galleryImageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("galleryUniqueName") String galleryUniqueName, + @PathParam("galleryImageName") String galleryImageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String galleryUniqueName, SharedToValues sharedTo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + sharedTo, + 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 shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + sharedTo, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String galleryUniqueName, SharedToValues sharedTo) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, sharedTo), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String galleryUniqueName) { + final SharedToValues sharedTo = null; + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, sharedTo), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, galleryUniqueName, sharedTo, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String galleryUniqueName) { + final SharedToValues sharedTo = null; + return new PagedIterable<>(listAsync(location, galleryUniqueName, sharedTo)); + } + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context) { + return new PagedIterable<>(listAsync(location, galleryUniqueName, sharedTo, context)); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String galleryUniqueName, String galleryImageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String galleryUniqueName, String galleryImageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (galleryUniqueName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2020-09-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + galleryUniqueName, + galleryImageName, + accept, + context); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String galleryUniqueName, String galleryImageName) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryImageInner get(String location, String galleryUniqueName, String galleryImageName) { + return getAsync(location, galleryUniqueName, galleryImageName).block(); + } + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, Context context) { + return getWithResponseAsync(location, galleryUniqueName, galleryImageName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java new file mode 100644 index 0000000000000..619a182b5aab8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImagesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.SharedGalleryImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImage; +import com.azure.resourcemanager.compute.generated.models.SharedGalleryImages; +import com.azure.resourcemanager.compute.generated.models.SharedToValues; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharedGalleryImagesImpl implements SharedGalleryImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImagesImpl.class); + + private final SharedGalleryImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public SharedGalleryImagesImpl( + SharedGalleryImagesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location, String galleryUniqueName) { + PagedIterable inner = this.serviceClient().list(location, galleryUniqueName); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImageImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context) { + PagedIterable inner = + this.serviceClient().list(location, galleryUniqueName, sharedTo, context); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImageImpl(inner1, this.manager())); + } + + public SharedGalleryImage get(String location, String galleryUniqueName, String galleryImageName) { + SharedGalleryImageInner inner = this.serviceClient().get(location, galleryUniqueName, galleryImageName); + if (inner != null) { + return new SharedGalleryImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, galleryUniqueName, galleryImageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SharedGalleryImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SharedGalleryImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImpl.java new file mode 100644 index 0000000000000..d8fdf33036ec2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharedGalleryImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.compute.generated.models.SharedGallery; + +public final class SharedGalleryImpl implements SharedGallery { + private SharedGalleryInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + SharedGalleryImpl( + SharedGalleryInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public SharedGalleryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharingUpdateImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharingUpdateImpl.java new file mode 100644 index 0000000000000..ddc7a5b2be62f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SharingUpdateImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup; +import com.azure.resourcemanager.compute.generated.models.SharingUpdate; +import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes; +import java.util.Collections; +import java.util.List; + +public final class SharingUpdateImpl implements SharingUpdate { + private SharingUpdateInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + SharingUpdateImpl( + SharingUpdateInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SharingUpdateOperationTypes operationType() { + return this.innerModel().operationType(); + } + + public List groups() { + List inner = this.innerModel().groups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SharingUpdateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java new file mode 100644 index 0000000000000..f0f9fd541fec3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.CreationData; +import com.azure.resourcemanager.compute.generated.models.DiskState; +import com.azure.resourcemanager.compute.generated.models.Encryption; +import com.azure.resourcemanager.compute.generated.models.EncryptionSettingsCollection; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.HyperVGeneration; +import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy; +import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes; +import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated; +import com.azure.resourcemanager.compute.generated.models.Snapshot; +import com.azure.resourcemanager.compute.generated.models.SnapshotSku; +import com.azure.resourcemanager.compute.generated.models.SnapshotUpdate; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition, Snapshot.Update { + private SnapshotInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String managedBy() { + return this.innerModel().managedBy(); + } + + public SnapshotSku sku() { + return this.innerModel().sku(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public OffsetDateTime timeCreated() { + return this.innerModel().timeCreated(); + } + + public OperatingSystemTypes osType() { + return this.innerModel().osType(); + } + + public HyperVGeneration hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public PurchasePlanAutoGenerated purchasePlan() { + return this.innerModel().purchasePlan(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public Integer diskSizeGB() { + return this.innerModel().diskSizeGB(); + } + + public Long diskSizeBytes() { + return this.innerModel().diskSizeBytes(); + } + + public DiskState diskState() { + return this.innerModel().diskState(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.innerModel().encryptionSettingsCollection(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean incremental() { + return this.innerModel().incremental(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public NetworkAccessPolicy networkAccessPolicy() { + return this.innerModel().networkAccessPolicy(); + } + + public String diskAccessId() { + return this.innerModel().diskAccessId(); + } + + public Boolean supportsHibernation() { + return this.innerModel().supportsHibernation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String snapshotName; + + private SnapshotUpdate updateSnapshot; + + public SnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Snapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdate(resourceGroupName, snapshotName, this.innerModel(), Context.NONE); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdate(resourceGroupName, snapshotName, this.innerModel(), context); + return this; + } + + SnapshotImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.snapshotName = name; + } + + public SnapshotImpl update() { + this.updateSnapshot = new SnapshotUpdate(); + return this; + } + + public Snapshot apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .update(resourceGroupName, snapshotName, updateSnapshot, Context.NONE); + return this; + } + + public Snapshot apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .update(resourceGroupName, snapshotName, updateSnapshot, context); + return this; + } + + SnapshotImpl(SnapshotInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.snapshotName = Utils.getValueFromIdByName(innerObject.id(), "snapshots"); + } + + public Snapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, snapshotName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, snapshotName, context) + .getValue(); + return this; + } + + public AccessUri grantAccess(GrantAccessData grantAccessData) { + return serviceManager.snapshots().grantAccess(resourceGroupName, snapshotName, grantAccessData); + } + + public AccessUri grantAccess(GrantAccessData grantAccessData, Context context) { + return serviceManager.snapshots().grantAccess(resourceGroupName, snapshotName, grantAccessData, context); + } + + public void revokeAccess() { + serviceManager.snapshots().revokeAccess(resourceGroupName, snapshotName); + } + + public void revokeAccess(Context context) { + serviceManager.snapshots().revokeAccess(resourceGroupName, snapshotName, context); + } + + public SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSnapshot.withTags(tags); + return this; + } + } + + public SnapshotImpl withSku(SnapshotSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateSnapshot.withSku(sku); + return this; + } + } + + public SnapshotImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public SnapshotImpl withOsType(OperatingSystemTypes osType) { + if (isInCreateMode()) { + this.innerModel().withOsType(osType); + return this; + } else { + this.updateSnapshot.withOsType(osType); + return this; + } + } + + public SnapshotImpl withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.innerModel().withHyperVGeneration(hyperVGeneration); + return this; + } + + public SnapshotImpl withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.innerModel().withPurchasePlan(purchasePlan); + return this; + } + + public SnapshotImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public SnapshotImpl withDiskSizeGB(Integer diskSizeGB) { + if (isInCreateMode()) { + this.innerModel().withDiskSizeGB(diskSizeGB); + return this; + } else { + this.updateSnapshot.withDiskSizeGB(diskSizeGB); + return this; + } + } + + public SnapshotImpl withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + if (isInCreateMode()) { + this.innerModel().withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } else { + this.updateSnapshot.withEncryptionSettingsCollection(encryptionSettingsCollection); + return this; + } + } + + public SnapshotImpl withIncremental(Boolean incremental) { + this.innerModel().withIncremental(incremental); + return this; + } + + public SnapshotImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateSnapshot.withEncryption(encryption); + return this; + } + } + + public SnapshotImpl withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + if (isInCreateMode()) { + this.innerModel().withNetworkAccessPolicy(networkAccessPolicy); + return this; + } else { + this.updateSnapshot.withNetworkAccessPolicy(networkAccessPolicy); + return this; + } + } + + public SnapshotImpl withDiskAccessId(String diskAccessId) { + if (isInCreateMode()) { + this.innerModel().withDiskAccessId(diskAccessId); + return this; + } else { + this.updateSnapshot.withDiskAccessId(diskAccessId); + return this; + } + } + + public SnapshotImpl withSupportsHibernation(Boolean supportsHibernation) { + if (isInCreateMode()) { + this.innerModel().withSupportsHibernation(supportsHibernation); + return this; + } else { + this.updateSnapshot.withSupportsHibernation(supportsHibernation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java new file mode 100644 index 0000000000000..3b416b5f7c1ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsClientImpl.java @@ -0,0 +1,2099 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.SnapshotList; +import com.azure.resourcemanager.compute.generated.models.SnapshotUpdate; +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 SnapshotsClient. */ +public final class SnapshotsClientImpl implements SnapshotsClient { + private final ClientLogger logger = new ClientLogger(SnapshotsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SnapshotsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientSnapshots to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface SnapshotsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotInner snapshot, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotUpdate snapshot, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots") + @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.Compute/snapshots") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}/beginGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> grantAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GrantAccessData grantAccessData, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" + + "/{snapshotName}/endGetAccess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> revokeAccess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + 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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginCreateOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, Context.NONE); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginCreateOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).getSyncPoller(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context).getSyncPoller(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner createOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context).block(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, Context.NONE); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return beginUpdateAsync(resourceGroupName, snapshotName, snapshot).getSyncPoller(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context).getSyncPoller(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return beginUpdateAsync(resourceGroupName, snapshotName, snapshot) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return updateAsync(resourceGroupName, snapshotName, snapshot).block(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner update( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return updateAsync(resourceGroupName, snapshotName, snapshot, context).block(); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String snapshotName) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + accept, + context); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName) { + return getByResourceGroupAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String snapshotName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName, context).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String snapshotName) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String snapshotName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String snapshotName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String snapshotName) { + return beginDeleteAsync(resourceGroupName, snapshotName).getSyncPoller(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String snapshotName, Context context) { + return beginDeleteAsync(resourceGroupName, snapshotName, context).getSyncPoller(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String snapshotName) { + return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String snapshotName, Context context) { + return beginDeleteAsync(resourceGroupName, snapshotName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 snapshotName) { + deleteAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 snapshotName, Context context) { + deleteAsync(resourceGroupName, snapshotName, context).block(); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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 snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 snapshots under 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 List Snapshots operation response. + */ + @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 apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + accept, + context); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, Context.NONE); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AccessUriInner> beginGrantAccessAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class, context); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).getSyncPoller(); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context).getSyncPoller(); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono grantAccessAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData).block(); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String snapshotName) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2020-12-01"; + context = this.client.mergeContext(context); + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync(String resourceGroupName, String snapshotName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevokeAccessAsync( + String resourceGroupName, String snapshotName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String snapshotName) { + return beginRevokeAccessAsync(resourceGroupName, snapshotName).getSyncPoller(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevokeAccess( + String resourceGroupName, String snapshotName, Context context) { + return beginRevokeAccessAsync(resourceGroupName, snapshotName, context).getSyncPoller(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { + return beginRevokeAccessAsync(resourceGroupName, snapshotName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAccessAsync(String resourceGroupName, String snapshotName, Context context) { + return beginRevokeAccessAsync(resourceGroupName, snapshotName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 revokeAccess(String resourceGroupName, String snapshotName) { + revokeAccessAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 revokeAccess(String resourceGroupName, String snapshotName, Context context) { + revokeAccessAsync(resourceGroupName, snapshotName, context).block(); + } + + /** + * 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 the List Snapshots operation response. + */ + @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 the List Snapshots operation response. + */ + @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 the List Snapshots operation response. + */ + @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 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 List Snapshots operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java new file mode 100644 index 0000000000000..1b7d6e7920505 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotsImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.compute.generated.models.AccessUri; +import com.azure.resourcemanager.compute.generated.models.GrantAccessData; +import com.azure.resourcemanager.compute.generated.models.Snapshot; +import com.azure.resourcemanager.compute.generated.models.Snapshots; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SnapshotsImpl implements Snapshots { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotsImpl.class); + + private final SnapshotsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public SnapshotsImpl( + SnapshotsClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Snapshot getByResourceGroup(String resourceGroupName, String snapshotName) { + SnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, snapshotName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String snapshotName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, snapshotName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String snapshotName) { + this.serviceClient().delete(resourceGroupName, snapshotName); + } + + public void delete(String resourceGroupName, String snapshotName, Context context) { + this.serviceClient().delete(resourceGroupName, snapshotName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public AccessUri grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + AccessUriInner inner = this.serviceClient().grantAccess(resourceGroupName, snapshotName, grantAccessData); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public AccessUri grantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + AccessUriInner inner = + this.serviceClient().grantAccess(resourceGroupName, snapshotName, grantAccessData, context); + if (inner != null) { + return new AccessUriImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeAccess(String resourceGroupName, String snapshotName) { + this.serviceClient().revokeAccess(resourceGroupName, snapshotName); + } + + public void revokeAccess(String resourceGroupName, String snapshotName, Context context) { + this.serviceClient().revokeAccess(resourceGroupName, snapshotName, context); + } + + public Snapshot 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, snapshotName, 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, snapshotName, 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, snapshotName, Context.NONE); + } + + public void deleteByIdWithResponse(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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, snapshotName, context); + } + + private SnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyGenerateKeyPairResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyGenerateKeyPairResultImpl.java new file mode 100644 index 0000000000000..eb21ad810febf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyGenerateKeyPairResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyGenerateKeyPairResult; + +public final class SshPublicKeyGenerateKeyPairResultImpl implements SshPublicKeyGenerateKeyPairResult { + private SshPublicKeyGenerateKeyPairResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + SshPublicKeyGenerateKeyPairResultImpl( + SshPublicKeyGenerateKeyPairResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String privateKey() { + return this.innerModel().privateKey(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public String id() { + return this.innerModel().id(); + } + + public SshPublicKeyGenerateKeyPairResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.java new file mode 100644 index 0000000000000..2f70181303fae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyGenerateKeyPairResult; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyUpdateResource; +import java.util.Collections; +import java.util.Map; + +public final class SshPublicKeyResourceImpl + implements SshPublicKeyResource, SshPublicKeyResource.Definition, SshPublicKeyResource.Update { + private SshPublicKeyResourceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String publicKey() { + return this.innerModel().publicKey(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SshPublicKeyResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sshPublicKeyName; + + private SshPublicKeyUpdateResource updateParameters; + + public SshPublicKeyResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SshPublicKeyResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .createWithResponse(resourceGroupName, sshPublicKeyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SshPublicKeyResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .createWithResponse(resourceGroupName, sshPublicKeyName, this.innerModel(), context) + .getValue(); + return this; + } + + SshPublicKeyResourceImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new SshPublicKeyResourceInner(); + this.serviceManager = serviceManager; + this.sshPublicKeyName = name; + } + + public SshPublicKeyResourceImpl update() { + this.updateParameters = new SshPublicKeyUpdateResource(); + return this; + } + + public SshPublicKeyResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .updateWithResponse(resourceGroupName, sshPublicKeyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SshPublicKeyResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .updateWithResponse(resourceGroupName, sshPublicKeyName, updateParameters, context) + .getValue(); + return this; + } + + SshPublicKeyResourceImpl( + SshPublicKeyResourceInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sshPublicKeyName = Utils.getValueFromIdByName(innerObject.id(), "sshPublicKeys"); + } + + public SshPublicKeyResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE) + .getValue(); + return this; + } + + public SshPublicKeyResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSshPublicKeys() + .getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, context) + .getValue(); + return this; + } + + public SshPublicKeyGenerateKeyPairResult generateKeyPair() { + return serviceManager.sshPublicKeys().generateKeyPair(resourceGroupName, sshPublicKeyName); + } + + public Response generateKeyPairWithResponse(Context context) { + return serviceManager.sshPublicKeys().generateKeyPairWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + public SshPublicKeyResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SshPublicKeyResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SshPublicKeyResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SshPublicKeyResourceImpl withPublicKey(String publicKey) { + if (isInCreateMode()) { + this.innerModel().withPublicKey(publicKey); + return this; + } else { + this.updateParameters.withPublicKey(publicKey); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java new file mode 100644 index 0000000000000..cd227273d6c17 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysClientImpl.java @@ -0,0 +1,1442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.SshPublicKeysClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyUpdateResource; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeysGroupListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SshPublicKeysClient. */ +public final class SshPublicKeysClientImpl implements SshPublicKeysClient { + private final ClientLogger logger = new ClientLogger(SshPublicKeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SshPublicKeysService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of SshPublicKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SshPublicKeysClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(SshPublicKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientSshPublicKeys to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface SshPublicKeysService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/sshPublicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @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.Compute" + + "/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sshPublicKeyName") String sshPublicKeyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SshPublicKeyResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sshPublicKeyName") String sshPublicKeyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SshPublicKeyUpdateResource parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sshPublicKeyName") String sshPublicKeyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/sshPublicKeys/{sshPublicKeyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sshPublicKeyName") String sshPublicKeyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/sshPublicKeys/{sshPublicKeyName}/generateKeyPair") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateKeyPair( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sshPublicKeyName") String sshPublicKeyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + + @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); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { + return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SshPublicKeyResourceInner create( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters) { + return createAsync(resourceGroupName, sshPublicKeyName, parameters).block(); + } + + /** + * Creates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to create the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, Context context) { + return createWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters, context).block(); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { + return updateWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SshPublicKeyResourceInner update( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters) { + return updateAsync(resourceGroupName, sshPublicKeyName, parameters).block(); + } + + /** + * Updates a new SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param parameters Parameters supplied to update the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String sshPublicKeyName, SshPublicKeyUpdateResource parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, sshPublicKeyName, parameters, context).block(); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String sshPublicKeyName) { + 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sshPublicKeyName) { + return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 sshPublicKeyName) { + deleteAsync(resourceGroupName, sshPublicKeyName).block(); + } + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sshPublicKeyName) { + 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sshPublicKeyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sshPublicKeyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SshPublicKeyResourceInner getByResourceGroup(String resourceGroupName, String sshPublicKeyName) { + return getByResourceGroupAsync(resourceGroupName, sshPublicKeyName).block(); + } + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateKeyPairWithResponseAsync( + String resourceGroupName, String sshPublicKeyName) { + 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateKeyPair( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateKeyPairWithResponseAsync( + String resourceGroupName, String sshPublicKeyName, 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 (sshPublicKeyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sshPublicKeyName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateKeyPair( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateKeyPairAsync( + String resourceGroupName, String sshPublicKeyName) { + return generateKeyPairWithResponseAsync(resourceGroupName, sshPublicKeyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SshPublicKeyGenerateKeyPairResultInner generateKeyPair(String resourceGroupName, String sshPublicKeyName) { + return generateKeyPairAsync(resourceGroupName, sshPublicKeyName).block(); + } + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateKeyPairWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + return generateKeyPairWithResponseAsync(resourceGroupName, sshPublicKeyName, context).block(); + } + + /** + * 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 the list SSH public keys operation response. + */ + @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 the list SSH public keys operation response. + */ + @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)); + } + + /** + * 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 the list SSH public keys operation response. + */ + @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 the list SSH public keys operation response. + */ + @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)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysImpl.java new file mode 100644 index 0000000000000..eb2ca25db185f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeysImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.SshPublicKeysClient; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyGenerateKeyPairResult; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource; +import com.azure.resourcemanager.compute.generated.models.SshPublicKeys; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SshPublicKeysImpl implements SshPublicKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeysImpl.class); + + private final SshPublicKeysClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public SshPublicKeysImpl( + SshPublicKeysClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SshPublicKeyResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SshPublicKeyResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SshPublicKeyResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SshPublicKeyResourceImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String sshPublicKeyName) { + this.serviceClient().delete(resourceGroupName, sshPublicKeyName); + } + + public Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + public SshPublicKeyResource getByResourceGroup(String resourceGroupName, String sshPublicKeyName) { + SshPublicKeyResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sshPublicKeyName); + if (inner != null) { + return new SshPublicKeyResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SshPublicKeyResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SshPublicKeyGenerateKeyPairResult generateKeyPair(String resourceGroupName, String sshPublicKeyName) { + SshPublicKeyGenerateKeyPairResultInner inner = + this.serviceClient().generateKeyPair(resourceGroupName, sshPublicKeyName); + if (inner != null) { + return new SshPublicKeyGenerateKeyPairResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateKeyPairWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context) { + Response inner = + this.serviceClient().generateKeyPairWithResponse(resourceGroupName, sshPublicKeyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SshPublicKeyGenerateKeyPairResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SshPublicKeyResource 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 sshPublicKeyName = Utils.getValueFromIdByName(id, "sshPublicKeys"); + if (sshPublicKeyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sshPublicKeys'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, 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 sshPublicKeyName = Utils.getValueFromIdByName(id, "sshPublicKeys"); + if (sshPublicKeyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sshPublicKeys'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sshPublicKeyName, 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 sshPublicKeyName = Utils.getValueFromIdByName(id, "sshPublicKeys"); + if (sshPublicKeyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sshPublicKeys'.", id))); + } + this.deleteWithResponse(resourceGroupName, sshPublicKeyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(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 sshPublicKeyName = Utils.getValueFromIdByName(id, "sshPublicKeys"); + if (sshPublicKeyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sshPublicKeys'.", id))); + } + return this.deleteWithResponse(resourceGroupName, sshPublicKeyName, context); + } + + private SshPublicKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public SshPublicKeyResourceImpl define(String name) { + return new SshPublicKeyResourceImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java new file mode 100644 index 0000000000000..5bee57378fa7e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpdateDomainImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.azure.resourcemanager.compute.generated.models.UpdateDomain; + +public final class UpdateDomainImpl implements UpdateDomain { + private UpdateDomainInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UpdateDomainImpl( + UpdateDomainInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public UpdateDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java new file mode 100644 index 0000000000000..54081979ebba3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UpgradeOperationHistoricalStatusInfoImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfo; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfoProperties; + +public final class UpgradeOperationHistoricalStatusInfoImpl implements UpgradeOperationHistoricalStatusInfo { + private UpgradeOperationHistoricalStatusInfoInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UpgradeOperationHistoricalStatusInfoImpl( + UpgradeOperationHistoricalStatusInfoInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UpgradeOperationHistoricalStatusInfoProperties properties() { + return this.innerModel().properties(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public UpgradeOperationHistoricalStatusInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..96124976a1abb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsageImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.compute.generated.models.Usage; +import com.azure.resourcemanager.compute.generated.models.UsageName; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String unit() { + return this.innerModel().unit(); + } + + public int currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..fa4fd180e3a0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.UsagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.compute.generated.models.ListUsagesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(ComputeManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + 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())); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, 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 the List Usages operation response. + */ + @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 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 List Usages operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..226c2925388fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.UsagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.compute.generated.models.Usage; +import com.azure.resourcemanager.compute.generated.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/Utils.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/Utils.java new file mode 100644 index 0000000000000..6fa3fae68aec2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/Utils.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.compute.generated.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function 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); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineAssessPatchesResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineAssessPatchesResultImpl.java new file mode 100644 index 0000000000000..48d9f83dc7dc4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineAssessPatchesResultImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.PatchOperationStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAssessPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSoftwarePatchProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineAssessPatchesResultImpl implements VirtualMachineAssessPatchesResult { + private VirtualMachineAssessPatchesResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineAssessPatchesResultImpl( + VirtualMachineAssessPatchesResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PatchOperationStatus status() { + return this.innerModel().status(); + } + + public String assessmentActivityId() { + return this.innerModel().assessmentActivityId(); + } + + public Boolean rebootPending() { + return this.innerModel().rebootPending(); + } + + public Integer criticalAndSecurityPatchCount() { + return this.innerModel().criticalAndSecurityPatchCount(); + } + + public Integer otherPatchCount() { + return this.innerModel().otherPatchCount(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public List availablePatches() { + List inner = this.innerModel().availablePatches(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApiError error() { + return this.innerModel().error(); + } + + public VirtualMachineAssessPatchesResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineCaptureResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineCaptureResultImpl.java new file mode 100644 index 0000000000000..885cb878a37a5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineCaptureResultImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureResult; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineCaptureResultImpl implements VirtualMachineCaptureResult { + private VirtualMachineCaptureResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineCaptureResultImpl( + VirtualMachineCaptureResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String schema() { + return this.innerModel().schema(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public Object parameters() { + return this.innerModel().parameters(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineCaptureResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImageImpl.java new file mode 100644 index 0000000000000..d363a83b1f456 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImageImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImage; +import java.util.Collections; +import java.util.Map; + +public final class VirtualMachineExtensionImageImpl implements VirtualMachineExtensionImage { + private VirtualMachineExtensionImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineExtensionImageImpl( + VirtualMachineExtensionImageInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager 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 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 String operatingSystem() { + return this.innerModel().operatingSystem(); + } + + public String computeRole() { + return this.innerModel().computeRole(); + } + + public String handlerSchema() { + return this.innerModel().handlerSchema(); + } + + public Boolean vmScaleSetEnabled() { + return this.innerModel().vmScaleSetEnabled(); + } + + public Boolean supportsMultipleExtensions() { + return this.innerModel().supportsMultipleExtensions(); + } + + public VirtualMachineExtensionImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java new file mode 100644 index 0000000000000..e4f592870448e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesClientImpl.java @@ -0,0 +1,662 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineExtensionImagesClient. */ +public final class VirtualMachineExtensionImagesClientImpl implements VirtualMachineExtensionImagesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineExtensionImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineExtensionImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineExtensionImagesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineExtensionImagesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineExtensionImages to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineExtensionImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @PathParam("type") String type, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmextension/types") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listTypes( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listVersions( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @PathParam("type") String type, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version 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 a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisherName, String type, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (type == null) { + return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + publisherName, + type, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version 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 a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisherName, String type, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (type == null) { + return Mono.error(new IllegalArgumentException("Parameter type is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + publisherName, + type, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version 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 a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisherName, String type, String version) { + return getWithResponseAsync(location, publisherName, type, version) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version 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 a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionImageInner get(String location, String publisherName, String type, String version) { + return getAsync(location, publisherName, type, version).block(); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version 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 a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publisherName, String type, String version, Context context) { + return getWithResponseAsync(location, publisherName, type, version, context).block(); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listTypesWithResponseAsync( + String location, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listTypes( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listTypesWithResponseAsync( + String location, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listTypes( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTypesAsync(String location, String publisherName) { + return listTypesWithResponseAsync(location, publisherName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listTypes(String location, String publisherName) { + return listTypesAsync(location, publisherName).block(); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName 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 a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listTypesWithResponse( + String location, String publisherName, Context context) { + return listTypesWithResponseAsync(location, publisherName, context).block(); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listVersionsWithResponseAsync( + String location, String publisherName, String type, String filter, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (type == null) { + return Mono.error(new IllegalArgumentException("Parameter type 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVersions( + this.client.getEndpoint(), + location, + publisherName, + type, + filter, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listVersionsWithResponseAsync( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (type == null) { + return Mono.error(new IllegalArgumentException("Parameter type 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVersions( + this.client.getEndpoint(), + location, + publisherName, + type, + filter, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsAsync( + String location, String publisherName, String type, String filter, Integer top, String orderby) { + return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsAsync( + String location, String publisherName, String type) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listVersions(String location, String publisherName, String type) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return listVersionsAsync(location, publisherName, type, filter, top, orderby).block(); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context) { + return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.java new file mode 100644 index 0000000000000..b159339561b7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImagesImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineExtensionImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImage; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImages; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImagesImpl.class); + + private final VirtualMachineExtensionImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineExtensionImagesImpl( + VirtualMachineExtensionImagesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualMachineExtensionImage get(String location, String publisherName, String type, String version) { + VirtualMachineExtensionImageInner inner = this.serviceClient().get(location, publisherName, type, version); + if (inner != null) { + return new VirtualMachineExtensionImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, String publisherName, String type, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publisherName, type, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineExtensionImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public List listTypes(String location, String publisherName) { + List inner = this.serviceClient().listTypes(location, publisherName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listTypesWithResponse( + String location, String publisherName, Context context) { + Response> inner = + this.serviceClient().listTypesWithResponse(location, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineExtensionImageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listVersions(String location, String publisherName, String type) { + List inner = + this.serviceClient().listVersions(location, publisherName, type); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context) { + Response> inner = + this.serviceClient().listVersionsWithResponse(location, publisherName, type, filter, top, orderby, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineExtensionImageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private VirtualMachineExtensionImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java new file mode 100644 index 0000000000000..f0a82a4290dcf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionUpdate; +import java.util.Collections; +import java.util.Map; + +public final class VirtualMachineExtensionImpl + implements VirtualMachineExtension, VirtualMachineExtension.Definition, VirtualMachineExtension.Update { + private VirtualMachineExtensionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Object settings() { + return this.innerModel().settings(); + } + + public Object protectedSettings() { + return this.innerModel().protectedSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineExtensionInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualMachineExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmName; + + private String vmExtensionName; + + private VirtualMachineExtensionUpdate updateExtensionParameters; + + public VirtualMachineExtensionImpl withExistingVirtualMachine(String resourceGroupName, String vmName) { + this.resourceGroupName = resourceGroupName; + this.vmName = vmName; + return this; + } + + public VirtualMachineExtension create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .createOrUpdate(resourceGroupName, vmName, vmExtensionName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineExtension create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .createOrUpdate(resourceGroupName, vmName, vmExtensionName, this.innerModel(), context); + return this; + } + + VirtualMachineExtensionImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineExtensionInner(); + this.serviceManager = serviceManager; + this.vmExtensionName = name; + } + + public VirtualMachineExtensionImpl update() { + this.updateExtensionParameters = new VirtualMachineExtensionUpdate(); + return this; + } + + public VirtualMachineExtension apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .update(resourceGroupName, vmName, vmExtensionName, updateExtensionParameters, Context.NONE); + return this; + } + + public VirtualMachineExtension apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .update(resourceGroupName, vmName, vmExtensionName, updateExtensionParameters, context); + return this; + } + + VirtualMachineExtensionImpl( + VirtualMachineExtensionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.vmExtensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public VirtualMachineExtension refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .getWithResponse(resourceGroupName, vmName, vmExtensionName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineExtension refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineExtensions() + .getWithResponse(resourceGroupName, vmName, vmExtensionName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineExtensionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineExtensionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineExtensionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateExtensionParameters.withTags(tags); + return this; + } + } + + public VirtualMachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public VirtualMachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public VirtualMachineExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VirtualMachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public VirtualMachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public VirtualMachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public VirtualMachineExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public VirtualMachineExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public VirtualMachineExtensionImpl withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.innerModel().withInstanceView(instanceView); + return this; + } + + public VirtualMachineExtensionImpl withType(String type) { + this.updateExtensionParameters.withType(type); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java new file mode 100644 index 0000000000000..ceb67fcdf3a44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsClientImpl.java @@ -0,0 +1,1447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionUpdate; +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 VirtualMachineExtensionsClient. */ +public final class VirtualMachineExtensionsClientImpl implements VirtualMachineExtensionsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineExtensionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineExtensionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualMachineExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineExtensions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/extensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class, + Context.NONE); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class, + context); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + .getSyncPoller(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner createOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner createOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineExtensionInner> beginUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class, + Context.NONE); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineExtensionInner> beginUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class, + context); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).getSyncPoller(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner update( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner update( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, String vmExtensionName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, String vmExtensionName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, String vmExtensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName) { + return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName).getSyncPoller(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context).getSyncPoller(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmName, String vmExtensionName) { + deleteAsync(resourceGroupName, vmName, vmExtensionName).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmName, String vmExtensionName, Context context) { + deleteAsync(resourceGroupName, vmName, vmExtensionName, context).block(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmName, String vmExtensionName, String expand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmName, String vmExtensionName, String expand, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmName, String vmExtensionName, String expand) { + return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmName, String vmExtensionName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName) { + final String expand = null; + return getAsync(resourceGroupName, vmName, vmExtensionName, expand).block(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand, context).block(); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String vmName, String expand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String vmName, String expand, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String vmName, String expand) { + return listWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String vmName) { + final String expand = null; + return listWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmName) { + final String expand = null; + return listAsync(resourceGroupName, vmName, expand).block(); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String vmName, String expand, Context context) { + return listWithResponseAsync(resourceGroupName, vmName, expand, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.java new file mode 100644 index 0000000000000..6083b8cb9624b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionsListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineExtensionsImpl implements VirtualMachineExtensions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsImpl.class); + + private final VirtualMachineExtensionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineExtensionsImpl( + VirtualMachineExtensionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String vmName, String vmExtensionName) { + this.serviceClient().delete(resourceGroupName, vmName, vmExtensionName); + } + + public void delete(String resourceGroupName, String vmName, String vmExtensionName, Context context) { + this.serviceClient().delete(resourceGroupName, vmName, vmExtensionName, context); + } + + public VirtualMachineExtension get(String resourceGroupName, String vmName, String vmExtensionName) { + VirtualMachineExtensionInner inner = this.serviceClient().get(resourceGroupName, vmName, vmExtensionName); + if (inner != null) { + return new VirtualMachineExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vmName, vmExtensionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineExtensionsListResult list(String resourceGroupName, String vmName) { + VirtualMachineExtensionsListResultInner inner = this.serviceClient().list(resourceGroupName, vmName); + if (inner != null) { + return new VirtualMachineExtensionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String vmName, String expand, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, vmName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineExtensionsListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineExtension 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + String localExpand = null; + return this.getWithResponse(resourceGroupName, vmName, vmExtensionName, localExpand, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, vmName, vmExtensionName, expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmName, vmExtensionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmName, vmExtensionName, context); + } + + private VirtualMachineExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineExtensionImpl define(String name) { + return new VirtualMachineExtensionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsListResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsListResultImpl.java new file mode 100644 index 0000000000000..ffdfee4c36d6c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineExtensionsListResultImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionsListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineExtensionsListResultImpl implements VirtualMachineExtensionsListResult { + private VirtualMachineExtensionsListResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineExtensionsListResultImpl( + VirtualMachineExtensionsListResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineExtensionsListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.java new file mode 100644 index 0000000000000..dd946463d05fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageImpl.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradeProperties; +import com.azure.resourcemanager.compute.generated.models.DataDiskImage; +import com.azure.resourcemanager.compute.generated.models.DisallowedConfiguration; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes; +import com.azure.resourcemanager.compute.generated.models.OSDiskImage; +import com.azure.resourcemanager.compute.generated.models.PurchasePlan; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImage; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageFeature; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineImageImpl implements VirtualMachineImage { + private VirtualMachineImageInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineImageImpl( + VirtualMachineImageInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PurchasePlan plan() { + return this.innerModel().plan(); + } + + public OSDiskImage osDiskImage() { + return this.innerModel().osDiskImage(); + } + + public List dataDiskImages() { + List inner = this.innerModel().dataDiskImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AutomaticOSUpgradeProperties automaticOSUpgradeProperties() { + return this.innerModel().automaticOSUpgradeProperties(); + } + + public HyperVGenerationTypes hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public DisallowedConfiguration disallowed() { + return this.innerModel().disallowed(); + } + + public List features() { + List inner = this.innerModel().features(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageResourceImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageResourceImpl.java new file mode 100644 index 0000000000000..773badd540a12 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImageResourceImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageResource; +import java.util.Collections; +import java.util.Map; + +public final class VirtualMachineImageResourceImpl implements VirtualMachineImageResource { + private VirtualMachineImageResourceInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineImageResourceImpl( + VirtualMachineImageResourceInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + 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 ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public VirtualMachineImageResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java new file mode 100644 index 0000000000000..af1b1303bafe9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesClientImpl.java @@ -0,0 +1,1014 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineImagesClient. */ +public final class VirtualMachineImagesClientImpl implements VirtualMachineImagesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineImagesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineImagesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualMachineImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineImages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @PathParam("skus") String skus, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @PathParam("skus") String skus, + @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmimage/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listOffers( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listPublishers( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" + + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listSkus( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisherName, String offer, String skus, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisherName, String offer, String skus, String version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisherName, String offer, String skus, String version) { + return getWithResponseAsync(location, publisherName, offer, skus, version) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineImageInner get( + String location, String publisherName, String offer, String skus, String version) { + return getAsync(location, publisherName, offer, skus, version).block(); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, Context context) { + return getWithResponseAsync(location, publisherName, offer, skus, version, context).block(); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync( + String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + location, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAsync( + String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { + return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAsync( + String location, String publisherName, String offer, String skus) { + final String expand = null; + final Integer top = null; + final String orderby = null; + return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List list( + String location, String publisherName, String offer, String skus) { + final String expand = null; + final Integer top = null; + final String orderby = null; + return listAsync(location, publisherName, offer, skus, expand, top, orderby).block(); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby 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 a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listWithResponse( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby, context).block(); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listOffersWithResponseAsync( + String location, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listOffersWithResponseAsync( + String location, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOffers( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOffersAsync(String location, String publisherName) { + return listOffersWithResponseAsync(location, publisherName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listOffers(String location, String publisherName) { + return listOffersAsync(location, publisherName).block(); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listOffersWithResponse( + String location, String publisherName, Context context) { + return listOffersWithResponseAsync(location, publisherName, context).block(); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listPublishersWithResponseAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listPublishersWithResponseAsync( + String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPublishers( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublishersAsync(String location) { + return listPublishersWithResponseAsync(location) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listPublishers(String location) { + return listPublishersAsync(location).block(); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listPublishersWithResponse( + String location, Context context) { + return listPublishersWithResponseAsync(location, context).block(); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSkusWithResponseAsync( + String location, String publisherName, String offer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + location, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSkusWithResponseAsync( + String location, String publisherName, String offer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkus( + this.client.getEndpoint(), + location, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusAsync( + String location, String publisherName, String offer) { + return listSkusWithResponseAsync(location, publisherName, offer) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listSkus(String location, String publisherName, String offer) { + return listSkusAsync(location, publisherName, offer).block(); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listSkusWithResponse( + String location, String publisherName, String offer, Context context) { + return listSkusWithResponseAsync(location, publisherName, offer, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java new file mode 100644 index 0000000000000..651d8869d6212 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesClientImpl.java @@ -0,0 +1,1139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineImagesEdgeZonesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineImagesEdgeZonesClient. */ +public final class VirtualMachineImagesEdgeZonesClientImpl implements VirtualMachineImagesEdgeZonesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineImagesEdgeZonesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineImagesEdgeZonesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineImagesEdgeZonesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineImagesEdgeZonesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineImagesEdgeZonesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineImagesEdgeZones to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineImagesEdgeZonesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}" + + "/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("edgeZone") String edgeZone, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @PathParam("skus") String skus, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}" + + "/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("edgeZone") String edgeZone, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @PathParam("skus") String skus, + @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}" + + "/publishers/{publisherName}/artifacttypes/vmimage/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> listOffers( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("edgeZone") String edgeZone, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}" + + "/publishers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> listPublishers( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("edgeZone") String edgeZone, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}" + + "/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> listSkus( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("edgeZone") String edgeZone, + @PathParam("publisherName") String publisherName, + @PathParam("offer") String offer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String edgeZone, String publisherName, String offer, String skus, String version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + version, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String edgeZone, String publisherName, String offer, String skus, String version) { + return getWithResponseAsync(location, edgeZone, publisherName, offer, skus, version) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineImageInner get( + String location, String edgeZone, String publisherName, String offer, String skus, String version) { + return getAsync(location, edgeZone, publisherName, offer, skus, version).block(); + } + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + Context context) { + return getWithResponseAsync(location, edgeZone, publisherName, offer, skus, version, context).block(); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer is required and cannot be null.")); + } + if (skus == null) { + return Mono.error(new IllegalArgumentException("Parameter skus 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + skus, + expand, + top, + orderby, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAsync( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby) { + return listWithResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAsync( + String location, String edgeZone, String publisherName, String offer, String skus) { + final String expand = null; + final Integer top = null; + final String orderby = null; + return listWithResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List list( + String location, String edgeZone, String publisherName, String offer, String skus) { + final String expand = null; + final Integer top = null; + final String orderby = null; + return listAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).block(); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + return listWithResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby, context) + .block(); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listOffersWithResponseAsync( + String location, String edgeZone, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listOffersWithResponseAsync( + String location, String edgeZone, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOffers( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOffersAsync( + String location, String edgeZone, String publisherName) { + return listOffersWithResponseAsync(location, edgeZone, publisherName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listOffers(String location, String edgeZone, String publisherName) { + return listOffersAsync(location, edgeZone, publisherName).block(); + } + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, Context context) { + return listOffersWithResponseAsync(location, edgeZone, publisherName, context).block(); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listPublishersWithResponseAsync( + String location, String edgeZone) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listPublishersWithResponseAsync( + String location, String edgeZone, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPublishers( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublishersAsync(String location, String edgeZone) { + return listPublishersWithResponseAsync(location, edgeZone) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listPublishers(String location, String edgeZone) { + return listPublishersAsync(location, edgeZone).block(); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listPublishersWithResponse( + String location, String edgeZone, Context context) { + return listPublishersWithResponseAsync(location, edgeZone, context).block(); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSkusWithResponseAsync( + String location, String edgeZone, String publisherName, String offer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSkusWithResponseAsync( + String location, String edgeZone, String publisherName, String offer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (edgeZone == null) { + return Mono.error(new IllegalArgumentException("Parameter edgeZone is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offer == null) { + return Mono.error(new IllegalArgumentException("Parameter offer 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkus( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusAsync( + String location, String edgeZone, String publisherName, String offer) { + return listSkusWithResponseAsync(location, edgeZone, publisherName, offer) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listSkus( + String location, String edgeZone, String publisherName, String offer) { + return listSkusAsync(location, edgeZone, publisherName, offer).block(); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, Context context) { + return listSkusWithResponseAsync(location, edgeZone, publisherName, offer, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.java new file mode 100644 index 0000000000000..d8083500da65d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesEdgeZonesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineImagesEdgeZonesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImage; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageResource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImagesEdgeZones; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineImagesEdgeZonesImpl implements VirtualMachineImagesEdgeZones { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImagesEdgeZonesImpl.class); + + private final VirtualMachineImagesEdgeZonesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineImagesEdgeZonesImpl( + VirtualMachineImagesEdgeZonesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualMachineImage get( + String location, String edgeZone, String publisherName, String offer, String skus, String version) { + VirtualMachineImageInner inner = + this.serviceClient().get(location, edgeZone, publisherName, offer, skus, version); + if (inner != null) { + return new VirtualMachineImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + Context context) { + Response inner = + this.serviceClient().getWithResponse(location, edgeZone, publisherName, offer, skus, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public List list( + String location, String edgeZone, String publisherName, String offer, String skus) { + List inner = + this.serviceClient().list(location, edgeZone, publisherName, offer, skus); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + Response> inner = + this + .serviceClient() + .listWithResponse(location, edgeZone, publisherName, offer, skus, expand, top, orderby, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listOffers(String location, String edgeZone, String publisherName) { + List inner = + this.serviceClient().listOffers(location, edgeZone, publisherName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, Context context) { + Response> inner = + this.serviceClient().listOffersWithResponse(location, edgeZone, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listPublishers(String location, String edgeZone) { + List inner = this.serviceClient().listPublishers(location, edgeZone); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listPublishersWithResponse( + String location, String edgeZone, Context context) { + Response> inner = + this.serviceClient().listPublishersWithResponse(location, edgeZone, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listSkus( + String location, String edgeZone, String publisherName, String offer) { + List inner = + this.serviceClient().listSkus(location, edgeZone, publisherName, offer); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, Context context) { + Response> inner = + this.serviceClient().listSkusWithResponse(location, edgeZone, publisherName, offer, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private VirtualMachineImagesEdgeZonesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java new file mode 100644 index 0000000000000..8fdc8a99a6eab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImagesImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineImagesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImage; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImageResource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineImages; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineImagesImpl implements VirtualMachineImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImagesImpl.class); + + private final VirtualMachineImagesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineImagesImpl( + VirtualMachineImagesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualMachineImage get(String location, String publisherName, String offer, String skus, String version) { + VirtualMachineImageInner inner = this.serviceClient().get(location, publisherName, offer, skus, version); + if (inner != null) { + return new VirtualMachineImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publisherName, offer, skus, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public List list(String location, String publisherName, String offer, String skus) { + List inner = this.serviceClient().list(location, publisherName, offer, skus); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listWithResponse( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + Response> inner = + this.serviceClient().listWithResponse(location, publisherName, offer, skus, expand, top, orderby, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listOffers(String location, String publisherName) { + List inner = this.serviceClient().listOffers(location, publisherName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listOffersWithResponse( + String location, String publisherName, Context context) { + Response> inner = + this.serviceClient().listOffersWithResponse(location, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listPublishers(String location) { + List inner = this.serviceClient().listPublishers(location); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listPublishersWithResponse(String location, Context context) { + Response> inner = + this.serviceClient().listPublishersWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public List listSkus(String location, String publisherName, String offer) { + List inner = this.serviceClient().listSkus(location, publisherName, offer); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listSkusWithResponse( + String location, String publisherName, String offer, Context context) { + Response> inner = + this.serviceClient().listSkusWithResponse(location, publisherName, offer, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new VirtualMachineImageResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private VirtualMachineImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java new file mode 100644 index 0000000000000..355e6cc6c93dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java @@ -0,0 +1,727 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAssessPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualMachineImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 Plan plan() { + return this.innerModel().plan(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public SubResource virtualMachineScaleSet() { + return this.innerModel().virtualMachineScaleSet(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public VirtualMachinePriorityTypes priority() { + return this.innerModel().priority(); + } + + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerModel().evictionPolicy(); + } + + public BillingProfile billingProfile() { + return this.innerModel().billingProfile(); + } + + public SubResource host() { + return this.innerModel().host(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + VirtualMachineInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String extensionsTimeBudget() { + return this.innerModel().extensionsTimeBudget(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerModel().scheduledEventsProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public CapacityReservationProfile capacityReservation() { + return this.innerModel().capacityReservation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmName; + + private VirtualMachineUpdateInner updateParameters; + + public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualMachine create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, vmName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachine create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, vmName, this.innerModel(), context); + return this; + } + + VirtualMachineImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineInner(); + this.serviceManager = serviceManager; + this.vmName = name; + } + + public VirtualMachineImpl update() { + this.updateParameters = new VirtualMachineUpdateInner(); + return this; + } + + public VirtualMachine apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, vmName, updateParameters, Context.NONE); + return this; + } + + public VirtualMachine apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, vmName, updateParameters, context); + return this; + } + + VirtualMachineImpl( + VirtualMachineInner innerObject, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + } + + public VirtualMachine refresh() { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, vmName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachine refresh(Context context) { + InstanceViewTypes localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, vmName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters) { + return serviceManager.virtualMachines().capture(resourceGroupName, vmName, parameters); + } + + public VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters, Context context) { + return serviceManager.virtualMachines().capture(resourceGroupName, vmName, parameters, context); + } + + public void convertToManagedDisks() { + serviceManager.virtualMachines().convertToManagedDisks(resourceGroupName, vmName); + } + + public void convertToManagedDisks(Context context) { + serviceManager.virtualMachines().convertToManagedDisks(resourceGroupName, vmName, context); + } + + public void deallocate() { + serviceManager.virtualMachines().deallocate(resourceGroupName, vmName); + } + + public void deallocate(Context context) { + serviceManager.virtualMachines().deallocate(resourceGroupName, vmName, context); + } + + public void generalize() { + serviceManager.virtualMachines().generalize(resourceGroupName, vmName); + } + + public Response generalizeWithResponse(Context context) { + return serviceManager.virtualMachines().generalizeWithResponse(resourceGroupName, vmName, context); + } + + public void powerOff(Boolean skipShutdown) { + serviceManager.virtualMachines().powerOff(resourceGroupName, vmName, skipShutdown); + } + + public void powerOff() { + serviceManager.virtualMachines().powerOff(resourceGroupName, vmName); + } + + public void powerOff(Boolean skipShutdown, Context context) { + serviceManager.virtualMachines().powerOff(resourceGroupName, vmName, skipShutdown, context); + } + + public void reapply() { + serviceManager.virtualMachines().reapply(resourceGroupName, vmName); + } + + public void reapply(Context context) { + serviceManager.virtualMachines().reapply(resourceGroupName, vmName, context); + } + + public void restart() { + serviceManager.virtualMachines().restart(resourceGroupName, vmName); + } + + public void restart(Context context) { + serviceManager.virtualMachines().restart(resourceGroupName, vmName, context); + } + + public void start() { + serviceManager.virtualMachines().start(resourceGroupName, vmName); + } + + public void start(Context context) { + serviceManager.virtualMachines().start(resourceGroupName, vmName, context); + } + + public void redeploy() { + serviceManager.virtualMachines().redeploy(resourceGroupName, vmName); + } + + public void redeploy(Context context) { + serviceManager.virtualMachines().redeploy(resourceGroupName, vmName, context); + } + + public void reimage(VirtualMachineReimageParameters parameters) { + serviceManager.virtualMachines().reimage(resourceGroupName, vmName, parameters); + } + + public void reimage() { + serviceManager.virtualMachines().reimage(resourceGroupName, vmName); + } + + public void reimage(VirtualMachineReimageParameters parameters, Context context) { + serviceManager.virtualMachines().reimage(resourceGroupName, vmName, parameters, context); + } + + public RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData() { + return serviceManager.virtualMachines().retrieveBootDiagnosticsData(resourceGroupName, vmName); + } + + public Response retrieveBootDiagnosticsDataWithResponse( + Integer sasUriExpirationTimeInMinutes, Context context) { + return serviceManager + .virtualMachines() + .retrieveBootDiagnosticsDataWithResponse(resourceGroupName, vmName, sasUriExpirationTimeInMinutes, context); + } + + public void performMaintenance() { + serviceManager.virtualMachines().performMaintenance(resourceGroupName, vmName); + } + + public void performMaintenance(Context context) { + serviceManager.virtualMachines().performMaintenance(resourceGroupName, vmName, context); + } + + public void simulateEviction() { + serviceManager.virtualMachines().simulateEviction(resourceGroupName, vmName); + } + + public Response simulateEvictionWithResponse(Context context) { + return serviceManager.virtualMachines().simulateEvictionWithResponse(resourceGroupName, vmName, context); + } + + public VirtualMachineAssessPatchesResult assessPatches() { + return serviceManager.virtualMachines().assessPatches(resourceGroupName, vmName); + } + + public VirtualMachineAssessPatchesResult assessPatches(Context context) { + return serviceManager.virtualMachines().assessPatches(resourceGroupName, vmName, context); + } + + public VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput) { + return serviceManager.virtualMachines().installPatches(resourceGroupName, vmName, installPatchesInput); + } + + public VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput, Context context) { + return serviceManager.virtualMachines().installPatches(resourceGroupName, vmName, installPatchesInput, context); + } + + public RunCommandResult runCommand(RunCommandInput parameters) { + return serviceManager.virtualMachines().runCommand(resourceGroupName, vmName, parameters); + } + + public RunCommandResult runCommand(RunCommandInput parameters, Context context) { + return serviceManager.virtualMachines().runCommand(resourceGroupName, vmName, parameters, 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 withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualMachineImpl withPlan(Plan plan) { + if (isInCreateMode()) { + this.innerModel().withPlan(plan); + return this; + } else { + this.updateParameters.withPlan(plan); + return this; + } + } + + public VirtualMachineImpl withIdentity(VirtualMachineIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public VirtualMachineImpl withZones(List zones) { + if (isInCreateMode()) { + this.innerModel().withZones(zones); + return this; + } else { + this.updateParameters.withZones(zones); + return this; + } + } + + public VirtualMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualMachineImpl withHardwareProfile(HardwareProfile hardwareProfile) { + if (isInCreateMode()) { + this.innerModel().withHardwareProfile(hardwareProfile); + return this; + } else { + this.updateParameters.withHardwareProfile(hardwareProfile); + return this; + } + } + + public VirtualMachineImpl withStorageProfile(StorageProfile storageProfile) { + if (isInCreateMode()) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } else { + this.updateParameters.withStorageProfile(storageProfile); + return this; + } + } + + public VirtualMachineImpl withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + if (isInCreateMode()) { + this.innerModel().withAdditionalCapabilities(additionalCapabilities); + return this; + } else { + this.updateParameters.withAdditionalCapabilities(additionalCapabilities); + return this; + } + } + + public VirtualMachineImpl withOsProfile(OSProfile osProfile) { + if (isInCreateMode()) { + this.innerModel().withOsProfile(osProfile); + return this; + } else { + this.updateParameters.withOsProfile(osProfile); + return this; + } + } + + public VirtualMachineImpl withNetworkProfile(NetworkProfile networkProfile) { + if (isInCreateMode()) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } else { + this.updateParameters.withNetworkProfile(networkProfile); + return this; + } + } + + public VirtualMachineImpl withSecurityProfile(SecurityProfile securityProfile) { + if (isInCreateMode()) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } else { + this.updateParameters.withSecurityProfile(securityProfile); + return this; + } + } + + public VirtualMachineImpl withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + if (isInCreateMode()) { + this.innerModel().withDiagnosticsProfile(diagnosticsProfile); + return this; + } else { + this.updateParameters.withDiagnosticsProfile(diagnosticsProfile); + return this; + } + } + + public VirtualMachineImpl withAvailabilitySet(SubResource availabilitySet) { + if (isInCreateMode()) { + this.innerModel().withAvailabilitySet(availabilitySet); + return this; + } else { + this.updateParameters.withAvailabilitySet(availabilitySet); + return this; + } + } + + public VirtualMachineImpl withVirtualMachineScaleSet(SubResource virtualMachineScaleSet) { + if (isInCreateMode()) { + this.innerModel().withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } else { + this.updateParameters.withVirtualMachineScaleSet(virtualMachineScaleSet); + return this; + } + } + + public VirtualMachineImpl withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } else { + this.updateParameters.withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + } + + public VirtualMachineImpl withPriority(VirtualMachinePriorityTypes priority) { + if (isInCreateMode()) { + this.innerModel().withPriority(priority); + return this; + } else { + this.updateParameters.withPriority(priority); + return this; + } + } + + public VirtualMachineImpl withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + if (isInCreateMode()) { + this.innerModel().withEvictionPolicy(evictionPolicy); + return this; + } else { + this.updateParameters.withEvictionPolicy(evictionPolicy); + return this; + } + } + + public VirtualMachineImpl withBillingProfile(BillingProfile billingProfile) { + if (isInCreateMode()) { + this.innerModel().withBillingProfile(billingProfile); + return this; + } else { + this.updateParameters.withBillingProfile(billingProfile); + return this; + } + } + + public VirtualMachineImpl withHost(SubResource host) { + if (isInCreateMode()) { + this.innerModel().withHost(host); + return this; + } else { + this.updateParameters.withHost(host); + return this; + } + } + + public VirtualMachineImpl withHostGroup(SubResource hostGroup) { + if (isInCreateMode()) { + this.innerModel().withHostGroup(hostGroup); + return this; + } else { + this.updateParameters.withHostGroup(hostGroup); + return this; + } + } + + public VirtualMachineImpl withLicenseType(String licenseType) { + if (isInCreateMode()) { + this.innerModel().withLicenseType(licenseType); + return this; + } else { + this.updateParameters.withLicenseType(licenseType); + return this; + } + } + + public VirtualMachineImpl withExtensionsTimeBudget(String extensionsTimeBudget) { + if (isInCreateMode()) { + this.innerModel().withExtensionsTimeBudget(extensionsTimeBudget); + return this; + } else { + this.updateParameters.withExtensionsTimeBudget(extensionsTimeBudget); + return this; + } + } + + public VirtualMachineImpl withPlatformFaultDomain(Integer platformFaultDomain) { + if (isInCreateMode()) { + this.innerModel().withPlatformFaultDomain(platformFaultDomain); + return this; + } else { + this.updateParameters.withPlatformFaultDomain(platformFaultDomain); + return this; + } + } + + public VirtualMachineImpl withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + if (isInCreateMode()) { + this.innerModel().withScheduledEventsProfile(scheduledEventsProfile); + return this; + } else { + this.updateParameters.withScheduledEventsProfile(scheduledEventsProfile); + return this; + } + } + + public VirtualMachineImpl withUserData(String userData) { + if (isInCreateMode()) { + this.innerModel().withUserData(userData); + return this; + } else { + this.updateParameters.withUserData(userData); + return this; + } + } + + public VirtualMachineImpl withCapacityReservation(CapacityReservationProfile capacityReservation) { + if (isInCreateMode()) { + this.innerModel().withCapacityReservation(capacityReservation); + return this; + } else { + this.updateParameters.withCapacityReservation(capacityReservation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstallPatchesResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstallPatchesResultImpl.java new file mode 100644 index 0000000000000..1c05453f22fc2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstallPatchesResultImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner; +import com.azure.resourcemanager.compute.generated.models.ApiError; +import com.azure.resourcemanager.compute.generated.models.PatchInstallationDetail; +import com.azure.resourcemanager.compute.generated.models.PatchOperationStatus; +import com.azure.resourcemanager.compute.generated.models.VMGuestPatchRebootStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineInstallPatchesResultImpl implements VirtualMachineInstallPatchesResult { + private VirtualMachineInstallPatchesResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineInstallPatchesResultImpl( + VirtualMachineInstallPatchesResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PatchOperationStatus status() { + return this.innerModel().status(); + } + + public String installationActivityId() { + return this.innerModel().installationActivityId(); + } + + public VMGuestPatchRebootStatus rebootStatus() { + return this.innerModel().rebootStatus(); + } + + public Boolean maintenanceWindowExceeded() { + return this.innerModel().maintenanceWindowExceeded(); + } + + public Integer excludedPatchCount() { + return this.innerModel().excludedPatchCount(); + } + + public Integer notSelectedPatchCount() { + return this.innerModel().notSelectedPatchCount(); + } + + public Integer pendingPatchCount() { + return this.innerModel().pendingPatchCount(); + } + + public Integer installedPatchCount() { + return this.innerModel().installedPatchCount(); + } + + public Integer failedPatchCount() { + return this.innerModel().failedPatchCount(); + } + + public List patches() { + List inner = this.innerModel().patches(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public ApiError error() { + return this.innerModel().error(); + } + + public VirtualMachineInstallPatchesResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstanceViewImpl.java new file mode 100644 index 0000000000000..ca75f21d9f2f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineInstanceViewImpl.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.BootDiagnosticsInstanceView; +import com.azure.resourcemanager.compute.generated.models.DiskInstanceView; +import com.azure.resourcemanager.compute.generated.models.HyperVGenerationType; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.MaintenanceRedeployStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAgentInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineHealthStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePatchStatus; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineInstanceViewImpl implements VirtualMachineInstanceView { + private VirtualMachineInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineInstanceViewImpl( + VirtualMachineInstanceViewInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer platformUpdateDomain() { + return this.innerModel().platformUpdateDomain(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public String computerName() { + return this.innerModel().computerName(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public HyperVGenerationType hyperVGeneration() { + return this.innerModel().hyperVGeneration(); + } + + public String rdpThumbPrint() { + return this.innerModel().rdpThumbPrint(); + } + + public VirtualMachineAgentInstanceView vmAgent() { + return this.innerModel().vmAgent(); + } + + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.innerModel().maintenanceRedeployStatus(); + } + + public List disks() { + List inner = this.innerModel().disks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineHealthStatus vmHealth() { + return this.innerModel().vmHealth(); + } + + public BootDiagnosticsInstanceView bootDiagnostics() { + return this.innerModel().bootDiagnostics(); + } + + public String assignedHost() { + return this.innerModel().assignedHost(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachinePatchStatus patchStatus() { + return this.innerModel().patchStatus(); + } + + public VirtualMachineInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandImpl.java new file mode 100644 index 0000000000000..e0fb4fe238f97 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineRunCommandImpl + implements VirtualMachineRunCommand, VirtualMachineRunCommand.Definition, VirtualMachineRunCommand.Update { + private VirtualMachineRunCommandInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 VirtualMachineRunCommandScriptSource source() { + return this.innerModel().source(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List protectedParameters() { + List inner = this.innerModel().protectedParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean asyncExecution() { + return this.innerModel().asyncExecution(); + } + + public String runAsUser() { + return this.innerModel().runAsUser(); + } + + public String runAsPassword() { + return this.innerModel().runAsPassword(); + } + + public Integer timeoutInSeconds() { + return this.innerModel().timeoutInSeconds(); + } + + public String outputBlobUri() { + return this.innerModel().outputBlobUri(); + } + + public String errorBlobUri() { + return this.innerModel().errorBlobUri(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineRunCommandInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualMachineRunCommandInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmName; + + private String runCommandName; + + private VirtualMachineRunCommandUpdate updateRunCommand; + + public VirtualMachineRunCommandImpl withExistingVirtualMachine(String resourceGroupName, String vmName) { + this.resourceGroupName = resourceGroupName; + this.vmName = vmName; + return this; + } + + public VirtualMachineRunCommand create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .createOrUpdate(resourceGroupName, vmName, runCommandName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineRunCommand create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .createOrUpdate(resourceGroupName, vmName, runCommandName, this.innerModel(), context); + return this; + } + + VirtualMachineRunCommandImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineRunCommandInner(); + this.serviceManager = serviceManager; + this.runCommandName = name; + } + + public VirtualMachineRunCommandImpl update() { + this.updateRunCommand = new VirtualMachineRunCommandUpdate(); + return this; + } + + public VirtualMachineRunCommand apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .update(resourceGroupName, vmName, runCommandName, updateRunCommand, Context.NONE); + return this; + } + + public VirtualMachineRunCommand apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .update(resourceGroupName, vmName, runCommandName, updateRunCommand, context); + return this; + } + + VirtualMachineRunCommandImpl( + VirtualMachineRunCommandInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.runCommandName = Utils.getValueFromIdByName(innerObject.id(), "runCommands"); + } + + public VirtualMachineRunCommand refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineRunCommand refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineRunCommands() + .getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineRunCommandImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineRunCommandImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineRunCommandImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRunCommand.withTags(tags); + return this; + } + } + + public VirtualMachineRunCommandImpl withSource(VirtualMachineRunCommandScriptSource source) { + if (isInCreateMode()) { + this.innerModel().withSource(source); + return this; + } else { + this.updateRunCommand.withSource(source); + return this; + } + } + + public VirtualMachineRunCommandImpl withParameters(List parameters) { + if (isInCreateMode()) { + this.innerModel().withParameters(parameters); + return this; + } else { + this.updateRunCommand.withParameters(parameters); + return this; + } + } + + public VirtualMachineRunCommandImpl withProtectedParameters(List protectedParameters) { + if (isInCreateMode()) { + this.innerModel().withProtectedParameters(protectedParameters); + return this; + } else { + this.updateRunCommand.withProtectedParameters(protectedParameters); + return this; + } + } + + public VirtualMachineRunCommandImpl withAsyncExecution(Boolean asyncExecution) { + if (isInCreateMode()) { + this.innerModel().withAsyncExecution(asyncExecution); + return this; + } else { + this.updateRunCommand.withAsyncExecution(asyncExecution); + return this; + } + } + + public VirtualMachineRunCommandImpl withRunAsUser(String runAsUser) { + if (isInCreateMode()) { + this.innerModel().withRunAsUser(runAsUser); + return this; + } else { + this.updateRunCommand.withRunAsUser(runAsUser); + return this; + } + } + + public VirtualMachineRunCommandImpl withRunAsPassword(String runAsPassword) { + if (isInCreateMode()) { + this.innerModel().withRunAsPassword(runAsPassword); + return this; + } else { + this.updateRunCommand.withRunAsPassword(runAsPassword); + return this; + } + } + + public VirtualMachineRunCommandImpl withTimeoutInSeconds(Integer timeoutInSeconds) { + if (isInCreateMode()) { + this.innerModel().withTimeoutInSeconds(timeoutInSeconds); + return this; + } else { + this.updateRunCommand.withTimeoutInSeconds(timeoutInSeconds); + return this; + } + } + + public VirtualMachineRunCommandImpl withOutputBlobUri(String outputBlobUri) { + if (isInCreateMode()) { + this.innerModel().withOutputBlobUri(outputBlobUri); + return this; + } else { + this.updateRunCommand.withOutputBlobUri(outputBlobUri); + return this; + } + } + + public VirtualMachineRunCommandImpl withErrorBlobUri(String errorBlobUri) { + if (isInCreateMode()) { + this.innerModel().withErrorBlobUri(errorBlobUri); + return this; + } else { + this.updateRunCommand.withErrorBlobUri(errorBlobUri); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsClientImpl.java new file mode 100644 index 0000000000000..406054e3808e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsClientImpl.java @@ -0,0 +1,1936 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.RunCommandListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandsListResult; +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 VirtualMachineRunCommandsClient. */ +public final class VirtualMachineRunCommandsClientImpl implements VirtualMachineRunCommandsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineRunCommandsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineRunCommandsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineRunCommandsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineRunCommandsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineRunCommands to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineRunCommandsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("commandId") String commandId, + @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.Compute" + + "/virtualMachines/{vmName}/runCommands/{runCommandName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineRunCommandInner runCommand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/runCommands/{runCommandName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineRunCommandUpdate runCommand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/runCommands/{runCommandName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/runCommands/{runCommandName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> getByVirtualMachine( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @PathParam("runCommandName") String runCommandName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/runCommands") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByVirtualMachine( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByVirtualMachineNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + 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())); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String commandId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + location, + commandId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String commandId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + location, + commandId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String commandId) { + return getWithResponseAsync(location, commandId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandDocumentInner get(String location, String commandId) { + return getAsync(location, commandId).block(); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String commandId, Context context) { + return getWithResponseAsync(location, commandId, context).block(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + Context.NONE); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + context); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).getSyncPoller(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).getSyncPoller(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return createOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).block(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).block(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + Context.NONE); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, runCommandName, runCommand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + context); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand).getSyncPoller(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).getSyncPoller(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return beginUpdateAsync(resourceGroupName, vmName, runCommandName, runCommand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner update( + String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return updateAsync(resourceGroupName, vmName, runCommandName, runCommand).block(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmName, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return updateAsync(resourceGroupName, vmName, runCommandName, runCommand, context).block(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, String runCommandName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, runCommandName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, String runCommandName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmName, runCommandName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String runCommandName) { + return beginDeleteAsync(resourceGroupName, vmName, runCommandName).getSyncPoller(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, String runCommandName, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, runCommandName, context).getSyncPoller(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, String runCommandName) { + return beginDeleteAsync(resourceGroupName, vmName, runCommandName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, String runCommandName, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, runCommandName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmName, String runCommandName) { + deleteAsync(resourceGroupName, vmName, runCommandName).block(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmName, String runCommandName, Context context) { + deleteAsync(resourceGroupName, vmName, runCommandName, context).block(); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByVirtualMachineWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName, String expand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .getByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByVirtualMachineWithResponseAsync( + String resourceGroupName, String vmName, String runCommandName, String expand, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .getByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByVirtualMachineAsync( + String resourceGroupName, String vmName, String runCommandName, String expand) { + return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByVirtualMachineAsync( + String resourceGroupName, String vmName, String runCommandName) { + final String expand = null; + return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner getByVirtualMachine( + String resourceGroupName, String vmName, String runCommandName) { + final String expand = null; + return getByVirtualMachineAsync(resourceGroupName, vmName, runCommandName, expand).block(); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, Context context) { + return getByVirtualMachineWithResponseAsync(resourceGroupName, vmName, runCommandName, expand, context).block(); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineSinglePageAsync( + String resourceGroupName, String vmName, String expand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .listByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + 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())); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineSinglePageAsync( + String resourceGroupName, String vmName, String expand, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualMachine( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineAsync( + String resourceGroupName, String vmName, String expand) { + return new PagedFlux<>( + () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand), + nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineAsync( + String resourceGroupName, String vmName) { + final String expand = null; + return new PagedFlux<>( + () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand), + nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineAsync( + String resourceGroupName, String vmName, String expand, Context context) { + return new PagedFlux<>( + () -> listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand, context), + nextLink -> listByVirtualMachineNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachine(String resourceGroupName, String vmName) { + final String expand = null; + return new PagedIterable<>(listByVirtualMachineAsync(resourceGroupName, vmName, expand)); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachine( + String resourceGroupName, String vmName, String expand, Context context) { + return new PagedIterable<>(listByVirtualMachineAsync(resourceGroupName, vmName, expand, 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 the List Virtual Machine operation response. + */ + @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, text/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 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 List Virtual Machine operation response. + */ + @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, text/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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineNextSinglePageAsync( + 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, text/json"; + return FluxUtil + .withContext( + context -> service.listByVirtualMachineNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineNextSinglePageAsync( + 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, text/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualMachineNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsImpl.java new file mode 100644 index 0000000000000..53c6bed0c0188 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineRunCommandsImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.VirtualMachineRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocument; +import com.azure.resourcemanager.compute.generated.models.RunCommandDocumentBase; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommands; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineRunCommandsImpl implements VirtualMachineRunCommands { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsImpl.class); + + private final VirtualMachineRunCommandsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineRunCommandsImpl( + VirtualMachineRunCommandsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new RunCommandDocumentBaseImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new RunCommandDocumentBaseImpl(inner1, this.manager())); + } + + public RunCommandDocument get(String location, String commandId) { + RunCommandDocumentInner inner = this.serviceClient().get(location, commandId); + if (inner != null) { + return new RunCommandDocumentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String location, String commandId, Context context) { + Response inner = this.serviceClient().getWithResponse(location, commandId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RunCommandDocumentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vmName, String runCommandName) { + this.serviceClient().delete(resourceGroupName, vmName, runCommandName); + } + + public void delete(String resourceGroupName, String vmName, String runCommandName, Context context) { + this.serviceClient().delete(resourceGroupName, vmName, runCommandName, context); + } + + public VirtualMachineRunCommand getByVirtualMachine( + String resourceGroupName, String vmName, String runCommandName) { + VirtualMachineRunCommandInner inner = + this.serviceClient().getByVirtualMachine(resourceGroupName, vmName, runCommandName); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineRunCommandImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByVirtualMachine(String resourceGroupName, String vmName) { + PagedIterable inner = + this.serviceClient().listByVirtualMachine(resourceGroupName, vmName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineRunCommandImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualMachine( + String resourceGroupName, String vmName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByVirtualMachine(resourceGroupName, vmName, expand, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineRunCommandImpl(inner1, this.manager())); + } + + public VirtualMachineRunCommand 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + String localExpand = null; + return this + .getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + return this.getByVirtualMachineWithResponse(resourceGroupName, vmName, runCommandName, expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + this.delete(resourceGroupName, vmName, runCommandName, Context.NONE); + } + + public void deleteByIdWithResponse(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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String runCommandName = Utils.getValueFromIdByName(id, "runCommands"); + if (runCommandName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'runCommands'.", id))); + } + this.delete(resourceGroupName, vmName, runCommandName, context); + } + + private VirtualMachineRunCommandsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineRunCommandImpl define(String name) { + return new VirtualMachineRunCommandImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionImpl.java new file mode 100644 index 0000000000000..a6ec7b198959b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionUpdate; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineScaleSetExtensionImpl + implements VirtualMachineScaleSetExtension, + VirtualMachineScaleSetExtension.Definition, + VirtualMachineScaleSetExtension.Update { + private VirtualMachineScaleSetExtensionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Object settings() { + return this.innerModel().settings(); + } + + public Object protectedSettings() { + return this.innerModel().protectedSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List provisionAfterExtensions() { + List inner = this.innerModel().provisionAfterExtensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineScaleSetExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmScaleSetName; + + private String vmssExtensionName; + + private VirtualMachineScaleSetExtensionUpdate updateExtensionParameters; + + public VirtualMachineScaleSetExtensionImpl withExistingVirtualMachineScaleSet( + String resourceGroupName, String vmScaleSetName) { + this.resourceGroupName = resourceGroupName; + this.vmScaleSetName = vmScaleSetName; + return this; + } + + public VirtualMachineScaleSetExtension create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineScaleSetExtension create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, this.innerModel(), context); + return this; + } + + VirtualMachineScaleSetExtensionImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineScaleSetExtensionInner(); + this.serviceManager = serviceManager; + this.vmssExtensionName = name; + } + + public VirtualMachineScaleSetExtensionImpl update() { + this.updateExtensionParameters = new VirtualMachineScaleSetExtensionUpdate(); + return this; + } + + public VirtualMachineScaleSetExtension apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .update(resourceGroupName, vmScaleSetName, vmssExtensionName, updateExtensionParameters, Context.NONE); + return this; + } + + public VirtualMachineScaleSetExtension apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .update(resourceGroupName, vmScaleSetName, vmssExtensionName, updateExtensionParameters, context); + return this; + } + + VirtualMachineScaleSetExtensionImpl( + VirtualMachineScaleSetExtensionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmScaleSetName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachineScaleSets"); + this.vmssExtensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public VirtualMachineScaleSetExtension refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineScaleSetExtension refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetExtensions() + .getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineScaleSetExtensionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualMachineScaleSetExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withTypePropertiesType(String typePropertiesType) { + if (isInCreateMode()) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } else { + this.updateExtensionParameters.withTypePropertiesType(typePropertiesType); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public VirtualMachineScaleSetExtensionImpl withProvisionAfterExtensions(List provisionAfterExtensions) { + if (isInCreateMode()) { + this.innerModel().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } else { + this.updateExtensionParameters.withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsClientImpl.java new file mode 100644 index 0000000000000..84d93caaac4d2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsClientImpl.java @@ -0,0 +1,1552 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionUpdate; +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 VirtualMachineScaleSetExtensionsClient. + */ +public final class VirtualMachineScaleSetExtensionsClientImpl implements VirtualMachineScaleSetExtensionsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetExtensionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetExtensionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineScaleSetExtensionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetExtensions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("vmssExtensionName") String vmssExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetExtensionInner extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("vmssExtensionName") String vmssExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetExtensionUpdate extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("vmssExtensionName") String vmssExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("vmssExtensionName") String vmssExtensionName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class, + Context.NONE); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class, + context); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + .getSyncPoller(); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).block(); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .block(); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetExtensionInner> + beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class, + Context.NONE); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetExtensionInner> + beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class, + context); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + .getSyncPoller(); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters) { + return updateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).block(); + } + + /** + * The operation to update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionUpdate extensionParameters, + Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).getSyncPoller(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).getSyncPoller(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, String vmssExtensionName) { + deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner get( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + final String expand = null; + return getAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand).block(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, context).block(); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + 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())); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vmScaleSetName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vmScaleSetName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vmScaleSetName) { + return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName)); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, 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 the List VM scale set extension operation response. + */ + @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 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 List VM scale set extension operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsImpl.java new file mode 100644 index 0000000000000..ce49b50baccb3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetExtensionsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.VirtualMachineScaleSetExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetExtensionsImpl implements VirtualMachineScaleSetExtensions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionsImpl.class); + + private final VirtualMachineScaleSetExtensionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetExtensionsImpl( + VirtualMachineScaleSetExtensionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, vmssExtensionName); + } + + public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, vmssExtensionName, context); + } + + public VirtualMachineScaleSetExtension get( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + VirtualMachineScaleSetExtensionInner inner = + this.serviceClient().get(resourceGroupName, vmScaleSetName, vmssExtensionName); + if (inner != null) { + return new VirtualMachineScaleSetExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vmScaleSetName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vmScaleSetName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetExtensionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vmScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetExtensionImpl(inner1, this.manager())); + } + + public VirtualMachineScaleSetExtension 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String vmssExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmssExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String vmssExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmssExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String vmssExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmssExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmScaleSetName, vmssExtensionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String vmssExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmssExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmScaleSetName, vmssExtensionName, context); + } + + private VirtualMachineScaleSetExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineScaleSetExtensionImpl define(String name) { + return new VirtualMachineScaleSetExtensionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.java new file mode 100644 index 0000000000000..d4a1ac983f69f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.java @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.ExtendedLocation; +import com.azure.resourcemanager.compute.generated.models.OrchestrationMode; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy; +import com.azure.resourcemanager.compute.generated.models.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineScaleSetImpl + implements VirtualMachineScaleSet, VirtualMachineScaleSet.Definition, VirtualMachineScaleSet.Update { + private VirtualMachineScaleSetInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public VirtualMachineScaleSetIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public UpgradePolicy upgradePolicy() { + return this.innerModel().upgradePolicy(); + } + + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.innerModel().automaticRepairsPolicy(); + } + + public VirtualMachineScaleSetVMProfile virtualMachineProfile() { + return this.innerModel().virtualMachineProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean overprovision() { + return this.innerModel().overprovision(); + } + + public Boolean doNotRunExtensionsOnOverprovisionedVMs() { + return this.innerModel().doNotRunExtensionsOnOverprovisionedVMs(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public Boolean singlePlacementGroup() { + return this.innerModel().singlePlacementGroup(); + } + + public Boolean zoneBalance() { + return this.innerModel().zoneBalance(); + } + + public Integer platformFaultDomainCount() { + return this.innerModel().platformFaultDomainCount(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public ScaleInPolicy scaleInPolicy() { + return this.innerModel().scaleInPolicy(); + } + + public OrchestrationMode orchestrationMode() { + return this.innerModel().orchestrationMode(); + } + + public SpotRestorePolicy spotRestorePolicy() { + return this.innerModel().spotRestorePolicy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualMachineScaleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmScaleSetName; + + private VirtualMachineScaleSetUpdate updateParameters; + + public VirtualMachineScaleSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualMachineScaleSet create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .createOrUpdate(resourceGroupName, vmScaleSetName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineScaleSet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .createOrUpdate(resourceGroupName, vmScaleSetName, this.innerModel(), context); + return this; + } + + VirtualMachineScaleSetImpl(String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineScaleSetInner(); + this.serviceManager = serviceManager; + this.vmScaleSetName = name; + } + + public VirtualMachineScaleSetImpl update() { + this.updateParameters = new VirtualMachineScaleSetUpdate(); + return this; + } + + public VirtualMachineScaleSet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .update(resourceGroupName, vmScaleSetName, updateParameters, Context.NONE); + return this; + } + + public VirtualMachineScaleSet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .update(resourceGroupName, vmScaleSetName, updateParameters, context); + return this; + } + + VirtualMachineScaleSetImpl( + VirtualMachineScaleSetInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmScaleSetName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachineScaleSets"); + } + + public VirtualMachineScaleSet refresh() { + ExpandTypesForGetVMScaleSets localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineScaleSet refresh(Context context) { + ExpandTypesForGetVMScaleSets localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, context) + .getValue(); + return this; + } + + public void deallocate(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().deallocate(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void deallocate() { + serviceManager.virtualMachineScaleSets().deallocate(resourceGroupName, vmScaleSetName); + } + + public void deallocate(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().deallocate(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion) { + serviceManager + .virtualMachineScaleSets() + .deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion); + } + + public void deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void deleteInstances( + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion, Context context) { + serviceManager + .virtualMachineScaleSets() + .deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context); + } + + public void powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager + .virtualMachineScaleSets() + .powerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs); + } + + public void powerOff() { + serviceManager.virtualMachineScaleSets().powerOff(resourceGroupName, vmScaleSetName); + } + + public void powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .powerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context); + } + + public void restart(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().restart(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void restart() { + serviceManager.virtualMachineScaleSets().restart(resourceGroupName, vmScaleSetName); + } + + public void restart(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().restart(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void start(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().start(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void start() { + serviceManager.virtualMachineScaleSets().start(resourceGroupName, vmScaleSetName); + } + + public void start(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().start(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void redeploy() { + serviceManager.virtualMachineScaleSets().redeploy(resourceGroupName, vmScaleSetName); + } + + public void redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().performMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void performMaintenance() { + serviceManager.virtualMachineScaleSets().performMaintenance(resourceGroupName, vmScaleSetName); + } + + public void performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .performMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Context context) { + serviceManager + .virtualMachineScaleSets() + .updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void reimage(VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + serviceManager.virtualMachineScaleSets().reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + } + + public void reimage() { + serviceManager.virtualMachineScaleSets().reimage(resourceGroupName, vmScaleSetName); + } + + public void reimage(VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, Context context) { + serviceManager + .virtualMachineScaleSets() + .reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); + } + + public void reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + serviceManager.virtualMachineScaleSets().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void reimageAll() { + serviceManager.virtualMachineScaleSets().reimageAll(resourceGroupName, vmScaleSetName); + } + + public void reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context) { + serviceManager.virtualMachineScaleSets().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void convertToSinglePlacementGroup(VMScaleSetConvertToSinglePlacementGroupInput parameters) { + serviceManager + .virtualMachineScaleSets() + .convertToSinglePlacementGroup(resourceGroupName, vmScaleSetName, parameters); + } + + public Response convertToSinglePlacementGroupWithResponse( + VMScaleSetConvertToSinglePlacementGroupInput parameters, Context context) { + return serviceManager + .virtualMachineScaleSets() + .convertToSinglePlacementGroupWithResponse(resourceGroupName, vmScaleSetName, parameters, context); + } + + public void setOrchestrationServiceState(OrchestrationServiceStateInput parameters) { + serviceManager + .virtualMachineScaleSets() + .setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState(OrchestrationServiceStateInput parameters, Context context) { + serviceManager + .virtualMachineScaleSets() + .setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters, context); + } + + public VirtualMachineScaleSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineScaleSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineScaleSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualMachineScaleSetImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public VirtualMachineScaleSetImpl withPlan(Plan plan) { + if (isInCreateMode()) { + this.innerModel().withPlan(plan); + return this; + } else { + this.updateParameters.withPlan(plan); + return this; + } + } + + public VirtualMachineScaleSetImpl withIdentity(VirtualMachineScaleSetIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public VirtualMachineScaleSetImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public VirtualMachineScaleSetImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualMachineScaleSetImpl withUpgradePolicy(UpgradePolicy upgradePolicy) { + if (isInCreateMode()) { + this.innerModel().withUpgradePolicy(upgradePolicy); + return this; + } else { + this.updateParameters.withUpgradePolicy(upgradePolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { + if (isInCreateMode()) { + this.innerModel().withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } else { + this.updateParameters.withAutomaticRepairsPolicy(automaticRepairsPolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withVirtualMachineProfile(VirtualMachineScaleSetVMProfile virtualMachineProfile) { + this.innerModel().withVirtualMachineProfile(virtualMachineProfile); + return this; + } + + public VirtualMachineScaleSetImpl withOverprovision(Boolean overprovision) { + if (isInCreateMode()) { + this.innerModel().withOverprovision(overprovision); + return this; + } else { + this.updateParameters.withOverprovision(overprovision); + return this; + } + } + + public VirtualMachineScaleSetImpl withDoNotRunExtensionsOnOverprovisionedVMs( + Boolean doNotRunExtensionsOnOverprovisionedVMs) { + if (isInCreateMode()) { + this.innerModel().withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); + return this; + } else { + this.updateParameters.withDoNotRunExtensionsOnOverprovisionedVMs(doNotRunExtensionsOnOverprovisionedVMs); + return this; + } + } + + public VirtualMachineScaleSetImpl withSinglePlacementGroup(Boolean singlePlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withSinglePlacementGroup(singlePlacementGroup); + return this; + } else { + this.updateParameters.withSinglePlacementGroup(singlePlacementGroup); + return this; + } + } + + public VirtualMachineScaleSetImpl withZoneBalance(Boolean zoneBalance) { + this.innerModel().withZoneBalance(zoneBalance); + return this; + } + + public VirtualMachineScaleSetImpl withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.innerModel().withPlatformFaultDomainCount(platformFaultDomainCount); + return this; + } + + public VirtualMachineScaleSetImpl withProximityPlacementGroup(SubResource proximityPlacementGroup) { + if (isInCreateMode()) { + this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); + return this; + } else { + this.updateParameters.withProximityPlacementGroup(proximityPlacementGroup); + return this; + } + } + + public VirtualMachineScaleSetImpl withHostGroup(SubResource hostGroup) { + this.innerModel().withHostGroup(hostGroup); + return this; + } + + public VirtualMachineScaleSetImpl withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + if (isInCreateMode()) { + this.innerModel().withAdditionalCapabilities(additionalCapabilities); + return this; + } else { + this.updateParameters.withAdditionalCapabilities(additionalCapabilities); + return this; + } + } + + public VirtualMachineScaleSetImpl withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + if (isInCreateMode()) { + this.innerModel().withScaleInPolicy(scaleInPolicy); + return this; + } else { + this.updateParameters.withScaleInPolicy(scaleInPolicy); + return this; + } + } + + public VirtualMachineScaleSetImpl withOrchestrationMode(OrchestrationMode orchestrationMode) { + this.innerModel().withOrchestrationMode(orchestrationMode); + return this; + } + + public VirtualMachineScaleSetImpl withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy) { + this.innerModel().withSpotRestorePolicy(spotRestorePolicy); + return this; + } + + public VirtualMachineScaleSetImpl withVirtualMachineProfile( + VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { + this.updateParameters.withVirtualMachineProfile(virtualMachineProfile); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetInstanceViewImpl.java new file mode 100644 index 0000000000000..b1d0e99ee7fc8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetInstanceViewImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceSummary; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetInstanceViewStatusesSummary; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionsSummary; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineScaleSetInstanceViewImpl implements VirtualMachineScaleSetInstanceView { + private VirtualMachineScaleSetInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetInstanceViewImpl( + VirtualMachineScaleSetInstanceViewInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine() { + return this.innerModel().virtualMachine(); + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List orchestrationServices() { + List inner = this.innerModel().orchestrationServices(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineScaleSetInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java new file mode 100644 index 0000000000000..bbff270611271 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesClientImpl.java @@ -0,0 +1,985 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +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 + * VirtualMachineScaleSetRollingUpgradesClient. + */ +public final class VirtualMachineScaleSetRollingUpgradesClientImpl + implements VirtualMachineScaleSetRollingUpgradesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetRollingUpgradesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetRollingUpgradesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetRollingUpgradesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetRollingUpgradesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineScaleSetRollingUpgradesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetRollingUpgrades to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetRollingUpgradesService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startOSUpgrade( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startExtensionUpgrade( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLatest( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel(String resourceGroupName, String vmScaleSetName) { + return beginCancelAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String vmScaleSetName, Context context) { + return beginCancelAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { + return beginCancelAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginCancelAsync(resourceGroupName, vmScaleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String vmScaleSetName) { + cancelAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String vmScaleSetName, Context context) { + cancelAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startOSUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startOSUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartOSUpgradeAsync( + String resourceGroupName, String vmScaleSetName) { + Mono>> mono = startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartOSUpgradeAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { + return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStartOSUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { + startOSUpgradeAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + startOSUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startExtensionUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startExtensionUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartExtensionUpgradeAsync( + String resourceGroupName, String vmScaleSetName) { + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartExtensionUpgradeAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName) { + return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).getSyncPoller(); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context).getSyncPoller(); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName) { + startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLatestWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLatest( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLatestWithResponseAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLatest( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLatestAsync(String resourceGroupName, String vmScaleSetName) { + return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName) { + return getLatestAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLatestWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesImpl.java new file mode 100644 index 0000000000000..e0e0be96d769c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetRollingUpgradesImpl.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.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +import com.azure.resourcemanager.compute.generated.models.RollingUpgradeStatusInfo; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetRollingUpgrades; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetRollingUpgradesImpl implements VirtualMachineScaleSetRollingUpgrades { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetRollingUpgradesImpl.class); + + private final VirtualMachineScaleSetRollingUpgradesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetRollingUpgradesImpl( + VirtualMachineScaleSetRollingUpgradesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void cancel(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().cancel(resourceGroupName, vmScaleSetName); + } + + public void cancel(String resourceGroupName, String vmScaleSetName, Context context) { + this.serviceClient().cancel(resourceGroupName, vmScaleSetName, context); + } + + public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().startOSUpgrade(resourceGroupName, vmScaleSetName); + } + + public void startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + this.serviceClient().startOSUpgrade(resourceGroupName, vmScaleSetName, context); + } + + public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().startExtensionUpgrade(resourceGroupName, vmScaleSetName); + } + + public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + this.serviceClient().startExtensionUpgrade(resourceGroupName, vmScaleSetName, context); + } + + public RollingUpgradeStatusInfo getLatest(String resourceGroupName, String vmScaleSetName) { + RollingUpgradeStatusInfoInner inner = this.serviceClient().getLatest(resourceGroupName, vmScaleSetName); + if (inner != null) { + return new RollingUpgradeStatusInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLatestWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + Response inner = + this.serviceClient().getLatestWithResponse(resourceGroupName, vmScaleSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RollingUpgradeStatusInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VirtualMachineScaleSetRollingUpgradesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetSkuImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetSkuImpl.java new file mode 100644 index 0000000000000..6045819a7677c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetSkuImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSkuCapacity; + +public final class VirtualMachineScaleSetSkuImpl implements VirtualMachineScaleSetSku { + private VirtualMachineScaleSetSkuInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetSkuImpl( + VirtualMachineScaleSetSkuInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public VirtualMachineScaleSetSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public VirtualMachineScaleSetSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionImpl.java new file mode 100644 index 0000000000000..7653b077dfc8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionImpl.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionUpdate; + +public final class VirtualMachineScaleSetVMExtensionImpl + implements VirtualMachineScaleSetVMExtension, + VirtualMachineScaleSetVMExtension.Definition, + VirtualMachineScaleSetVMExtension.Update { + private VirtualMachineScaleSetVMExtensionInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Object settings() { + return this.innerModel().settings(); + } + + public Object protectedSettings() { + return this.innerModel().protectedSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineExtensionInstanceView instanceView() { + return this.innerModel().instanceView(); + } + + public VirtualMachineScaleSetVMExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vmScaleSetName; + + private String instanceId; + + private String vmExtensionName; + + private VirtualMachineScaleSetVMExtensionUpdate updateExtensionParameters; + + public VirtualMachineScaleSetVMExtensionImpl withExistingVirtualMachine( + String resourceGroupName, String vmScaleSetName, String instanceId) { + this.resourceGroupName = resourceGroupName; + this.vmScaleSetName = vmScaleSetName; + this.instanceId = instanceId; + return this; + } + + public VirtualMachineScaleSetVMExtension create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .createOrUpdate( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachineScaleSetVMExtension create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .createOrUpdate( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.innerModel(), context); + return this; + } + + VirtualMachineScaleSetVMExtensionImpl( + String name, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = new VirtualMachineScaleSetVMExtensionInner(); + this.serviceManager = serviceManager; + this.vmExtensionName = name; + } + + public VirtualMachineScaleSetVMExtensionImpl update() { + this.updateExtensionParameters = new VirtualMachineScaleSetVMExtensionUpdate(); + return this; + } + + public VirtualMachineScaleSetVMExtension apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .update( + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + updateExtensionParameters, + Context.NONE); + return this; + } + + public VirtualMachineScaleSetVMExtension apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .update( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, updateExtensionParameters, context); + return this; + } + + VirtualMachineScaleSetVMExtensionImpl( + VirtualMachineScaleSetVMExtensionInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmScaleSetName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachineScaleSets"); + this.instanceId = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.vmExtensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public VirtualMachineScaleSetVMExtension refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .getWithResponse( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineScaleSetVMExtension refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSetVMExtensions() + .getWithResponse(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, localExpand, context) + .getValue(); + return this; + } + + public VirtualMachineScaleSetVMExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withTypePropertiesType(String typePropertiesType) { + if (isInCreateMode()) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } else { + this.updateExtensionParameters.withTypePropertiesType(typePropertiesType); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public VirtualMachineScaleSetVMExtensionImpl withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.innerModel().withInstanceView(instanceView); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java new file mode 100644 index 0000000000000..4497b9749d749 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsClientImpl.java @@ -0,0 +1,1606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionUpdate; +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 VirtualMachineScaleSetVMExtensionsClient. + */ +public final class VirtualMachineScaleSetVMExtensionsClientImpl implements VirtualMachineScaleSetVMExtensionsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetVMExtensionsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetVMExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetVMExtensionsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineScaleSetVMExtensionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMExtensions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetVMExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMExtensionInner extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("vmExtensionName") String vmExtensionName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMExtensionInner.class, + VirtualMachineScaleSetVMExtensionInner.class, + Context.NONE); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMExtensionInner.class, + VirtualMachineScaleSetVMExtensionInner.class, + context); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) + .getSyncPoller(); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) + .block(); + } + + /** + * The operation to create or update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionInner extensionParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .block(); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + accept, + context); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMExtensionInner> + beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMExtensionInner.class, + VirtualMachineScaleSetVMExtensionInner.class, + Context.NONE); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMExtensionInner> + beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMExtensionInner.class, + VirtualMachineScaleSetVMExtensionInner.class, + context); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) + .getSyncPoller(); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMExtensionInner> + beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .getSyncPoller(); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).block(); + } + + /** + * The operation to update the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + VirtualMachineScaleSetVMExtensionUpdate extensionParameters, + Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) + .block(); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).getSyncPoller(); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) + .getSyncPoller(); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).block(); + } + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context).block(); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + final String expand = null; + return getAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).block(); + } + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, context) + .block(); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final String expand = null; + return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMExtensionsListResultInner list( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final String expand = null; + return listAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + } + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { + return listWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context).block(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsImpl.java new file mode 100644 index 0000000000000..d90d2034e5f6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsImpl.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +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.compute.generated.fluent.VirtualMachineScaleSetVMExtensionsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensions; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionsListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetVMExtensionsImpl implements VirtualMachineScaleSetVMExtensions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsImpl.class); + + private final VirtualMachineScaleSetVMExtensionsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetVMExtensionsImpl( + VirtualMachineScaleSetVMExtensionsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName); + } + + public void delete( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context); + } + + public VirtualMachineScaleSetVMExtension get( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + VirtualMachineScaleSetVMExtensionInner inner = + this.serviceClient().get(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName); + if (inner != null) { + return new VirtualMachineScaleSetVMExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetVMExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineScaleSetVMExtensionsListResult list( + String resourceGroupName, String vmScaleSetName, String instanceId) { + VirtualMachineScaleSetVMExtensionsListResultInner inner = + this.serviceClient().list(resourceGroupName, vmScaleSetName, instanceId); + if (inner != null) { + return new VirtualMachineScaleSetVMExtensionsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, vmScaleSetName, instanceId, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetVMExtensionsListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineScaleSetVMExtension 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String instanceId = Utils.getValueFromIdByName(id, "virtualMachines"); + if (instanceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String instanceId = Utils.getValueFromIdByName(id, "virtualMachines"); + if (instanceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String instanceId = Utils.getValueFromIdByName(id, "virtualMachines"); + if (instanceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, Context.NONE); + } + + public void deleteByIdWithResponse(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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + String instanceId = Utils.getValueFromIdByName(id, "virtualMachines"); + if (instanceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String vmExtensionName = Utils.getValueFromIdByName(id, "extensions"); + if (vmExtensionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context); + } + + private VirtualMachineScaleSetVMExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineScaleSetVMExtensionImpl define(String name) { + return new VirtualMachineScaleSetVMExtensionImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java new file mode 100644 index 0000000000000..ea371c33074da --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensionsListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachineScaleSetVMExtensionsListResultImpl + implements VirtualMachineScaleSetVMExtensionsListResult { + private VirtualMachineScaleSetVMExtensionsListResultInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetVMExtensionsListResultImpl( + VirtualMachineScaleSetVMExtensionsListResultInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineScaleSetVMExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineScaleSetVMExtensionsListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.java new file mode 100644 index 0000000000000..1b1ea5000a46e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.Sku; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVM; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualMachineScaleSetVMImpl implements VirtualMachineScaleSetVM { + private VirtualMachineScaleSetVMInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetVMImpl( + VirtualMachineScaleSetVMInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager 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 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 String instanceId() { + return this.innerModel().instanceId(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualMachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean latestModelApplied() { + return this.innerModel().latestModelApplied(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public VirtualMachineScaleSetVMInstanceView instanceView() { + VirtualMachineScaleSetVMInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineScaleSetVMInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration() { + return this.innerModel().networkProfileConfiguration(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String modelDefinitionApplied() { + return this.innerModel().modelDefinitionApplied(); + } + + public VirtualMachineScaleSetVMProtectionPolicy protectionPolicy() { + return this.innerModel().protectionPolicy(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public VirtualMachineScaleSetVMInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMInstanceViewImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMInstanceViewImpl.java new file mode 100644 index 0000000000000..c3e76acd582d3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMInstanceViewImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.BootDiagnosticsInstanceView; +import com.azure.resourcemanager.compute.generated.models.DiskInstanceView; +import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus; +import com.azure.resourcemanager.compute.generated.models.MaintenanceRedeployStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAgentInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineHealthStatus; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceView; +import java.util.Collections; +import java.util.List; + +public final class VirtualMachineScaleSetVMInstanceViewImpl implements VirtualMachineScaleSetVMInstanceView { + private VirtualMachineScaleSetVMInstanceViewInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineScaleSetVMInstanceViewImpl( + VirtualMachineScaleSetVMInstanceViewInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer platformUpdateDomain() { + return this.innerModel().platformUpdateDomain(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public String rdpThumbPrint() { + return this.innerModel().rdpThumbPrint(); + } + + public VirtualMachineAgentInstanceView vmAgent() { + return this.innerModel().vmAgent(); + } + + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.innerModel().maintenanceRedeployStatus(); + } + + public List disks() { + List inner = this.innerModel().disks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachineHealthStatus vmHealth() { + return this.innerModel().vmHealth(); + } + + public BootDiagnosticsInstanceView bootDiagnostics() { + return this.innerModel().bootDiagnostics(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String assignedHost() { + return this.innerModel().assignedHost(); + } + + public String placementGroupId() { + return this.innerModel().placementGroupId(); + } + + public VirtualMachineScaleSetVMInstanceViewInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java new file mode 100644 index 0000000000000..83d0fc1cd0f02 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsClientImpl.java @@ -0,0 +1,1690 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandsListResult; +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 VirtualMachineScaleSetVMRunCommandsClient. + */ +public final class VirtualMachineScaleSetVMRunCommandsClientImpl implements VirtualMachineScaleSetVMRunCommandsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMRunCommandsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetVMRunCommandsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetVMRunCommandsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetVMRunCommandsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineScaleSetVMRunCommandsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMRunCommands to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetVMRunCommandsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineRunCommandInner runCommand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineRunCommandUpdate runCommand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("runCommandName") String runCommandName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @PathParam("runCommandName") String runCommandName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + Context.NONE); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + context); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) + .getSyncPoller(); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) + .getSyncPoller(); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).block(); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) + .block(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 (runCommand == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommand is required and cannot be null.")); + } else { + runCommand.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + runCommand, + accept, + context); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + Context.NONE); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineRunCommandInner> beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineRunCommandInner.class, + VirtualMachineRunCommandInner.class, + context); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) + .getSyncPoller(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineRunCommandInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) + .getSyncPoller(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).block(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context).block(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).getSyncPoller(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context).getSyncPoller(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).block(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context).block(); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (runCommandName == null) { + return Mono.error(new IllegalArgumentException("Parameter runCommandName 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineRunCommandInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + final String expand = null; + return getAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).block(); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, context) + .block(); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + 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())); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, instanceId, expand)); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @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, text/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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + @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, text/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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java new file mode 100644 index 0000000000000..733b86240a1b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMRunCommandsImpl.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.compute.generated.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.compute.generated.fluent.VirtualMachineScaleSetVMRunCommandsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMRunCommands; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetVMRunCommandsImpl implements VirtualMachineScaleSetVMRunCommands { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMRunCommandsImpl.class); + + private final VirtualMachineScaleSetVMRunCommandsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetVMRunCommandsImpl( + VirtualMachineScaleSetVMRunCommandsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualMachineRunCommand createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand) { + VirtualMachineRunCommandInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineRunCommand createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context) { + VirtualMachineRunCommandInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineRunCommand update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand) { + VirtualMachineRunCommandInner inner = + this.serviceClient().update(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineRunCommand update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context) { + VirtualMachineRunCommandInner inner = + this + .serviceClient() + .update(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand, context); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, runCommandName); + } + + public void delete( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, runCommandName, context); + } + + public VirtualMachineRunCommand get( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + VirtualMachineRunCommandInner inner = + this.serviceClient().get(resourceGroupName, vmScaleSetName, instanceId, runCommandName); + if (inner != null) { + return new VirtualMachineRunCommandImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineRunCommandImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vmScaleSetName, instanceId); + return Utils.mapPage(inner, inner1 -> new VirtualMachineRunCommandImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vmScaleSetName, instanceId, expand, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineRunCommandImpl(inner1, this.manager())); + } + + private VirtualMachineScaleSetVMRunCommandsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java new file mode 100644 index 0000000000000..43f246643f70c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java @@ -0,0 +1,4533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters; +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 VirtualMachineScaleSetVMsClient. */ +public final class VirtualMachineScaleSetVMsClientImpl implements VirtualMachineScaleSetVMsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetVMsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetVMsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetVMsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualMachineScaleSetVMsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSetVMs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetVMsService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimageAll( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("forceDeletion") Boolean forceDeletion, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("$expand") InstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @QueryParam("$filter") String filter, + @QueryParam("$select") String select, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("skipShutdown") Boolean skipShutdown, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> redeploy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> retrieveBootDiagnosticsData( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("sasUriExpirationTimeInMinutes") Integer sasUriExpirationTimeInMinutes, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> performMaintenance( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> simulateEviction( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runCommand( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RunCommandInput parameters, + @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); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (vmScaleSetVMReimageInput != null) { + vmScaleSetVMReimageInput.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (vmScaleSetVMReimageInput != null) { + vmScaleSetVMReimageInput.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + context); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) + .getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context) + .getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; + return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).block(); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String vmScaleSetName, String instanceId) { + final VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput = null; + reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput).block(); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + reimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context).block(); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAllAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAllAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAllAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { + reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMInner> beginUpdateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class, + Context.NONE); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetVMInner> beginUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class, + context); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).getSyncPoller(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).getSyncPoller(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner update( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).getSyncPoller(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context).getSyncPoller(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean forceDeletion = null; + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, String instanceId, Boolean forceDeletion) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).block(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean forceDeletion = null; + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion).block(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final InstanceViewTypes expand = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId) { + final InstanceViewTypes expand = null; + return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context).block(); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInstanceViewInner getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { + 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 (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + filter, + select, + expand, + apiVersion, + 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())); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + 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 (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + filter, + select, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + final String filter = null; + final String select = null; + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualMachineScaleSetName) { + final String filter = null; + final String select = null; + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context)); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).getSyncPoller(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).getSyncPoller(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { + restartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + restartAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { + startAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + startAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> retrieveBootDiagnosticsDataWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> retrieveBootDiagnosticsDataWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Integer sasUriExpirationTimeInMinutes) { + return retrieveBootDiagnosticsDataWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataAsync( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes) + .block(); + } + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + Context context) { + return retrieveBootDiagnosticsDataWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, context) + .block(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).getSyncPoller(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context).getSyncPoller(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> simulateEvictionWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> simulateEvictionWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono simulateEvictionAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId) { + simulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RunCommandResultInner.class, + RunCommandResultInner.class, + Context.NONE); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, context); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).getSyncPoller(); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).getSyncPoller(); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); + } + + /** + * 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 the List Virtual Machine Scale Set VMs operation response. + */ + @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 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 List Virtual Machine Scale Set VMs operation response. + */ + @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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsImpl.java new file mode 100644 index 0000000000000..95ac12f011592 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVM; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetVMsImpl implements VirtualMachineScaleSetVMs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMsImpl.class); + + private final VirtualMachineScaleSetVMsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetVMsImpl( + VirtualMachineScaleSetVMsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput); + } + + public void reimage(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName, instanceId); + } + + public void reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMReimageInput, context); + } + + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName, instanceId); + } + + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName, instanceId); + } + + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public VirtualMachineScaleSetVM update( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + VirtualMachineScaleSetVMInner inner = + this.serviceClient().update(resourceGroupName, vmScaleSetName, instanceId, parameters); + if (inner != null) { + return new VirtualMachineScaleSetVMImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineScaleSetVM update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + VirtualMachineScaleSetVMInner inner = + this.serviceClient().update(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + if (inner != null) { + return new VirtualMachineScaleSetVMImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, forceDeletion); + } + + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId); + } + + public void delete( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean forceDeletion, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, instanceId, forceDeletion, context); + } + + public VirtualMachineScaleSetVM get(String resourceGroupName, String vmScaleSetName, String instanceId) { + VirtualMachineScaleSetVMInner inner = this.serviceClient().get(resourceGroupName, vmScaleSetName, instanceId); + if (inner != null) { + return new VirtualMachineScaleSetVMImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vmScaleSetName, instanceId, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetVMImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineScaleSetVMInstanceView getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId) { + VirtualMachineScaleSetVMInstanceViewInner inner = + this.serviceClient().getInstanceView(resourceGroupName, vmScaleSetName, instanceId); + if (inner != null) { + return new VirtualMachineScaleSetVMInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Response inner = + this.serviceClient().getInstanceViewWithResponse(resourceGroupName, vmScaleSetName, instanceId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetVMInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetVMImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetVMImpl(inner1, this.manager())); + } + + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + } + + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName, instanceId); + } + + public void powerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context); + } + + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().restart(resourceGroupName, vmScaleSetName, instanceId); + } + + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().restart(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().start(resourceGroupName, vmScaleSetName, instanceId); + } + + public void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().start(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().redeploy(resourceGroupName, vmScaleSetName, instanceId); + } + + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().redeploy(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData( + String resourceGroupName, String vmScaleSetName, String instanceId) { + RetrieveBootDiagnosticsDataResultInner inner = + this.serviceClient().retrieveBootDiagnosticsData(resourceGroupName, vmScaleSetName, instanceId); + if (inner != null) { + return new RetrieveBootDiagnosticsDataResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + Context context) { + Response inner = + this + .serviceClient() + .retrieveBootDiagnosticsDataWithResponse( + resourceGroupName, vmScaleSetName, instanceId, sasUriExpirationTimeInMinutes, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RetrieveBootDiagnosticsDataResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().performMaintenance(resourceGroupName, vmScaleSetName, instanceId); + } + + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + this.serviceClient().performMaintenance(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.serviceClient().simulateEviction(resourceGroupName, vmScaleSetName, instanceId); + } + + public Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return this + .serviceClient() + .simulateEvictionWithResponse(resourceGroupName, vmScaleSetName, instanceId, context); + } + + public RunCommandResult runCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + RunCommandResultInner inner = + this.serviceClient().runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult runCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + RunCommandResultInner inner = + this.serviceClient().runCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private VirtualMachineScaleSetVMsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java new file mode 100644 index 0000000000000..6cfa086c6b9ef --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java @@ -0,0 +1,6631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListOSUpgradeHistory; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListSkusResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetListWithLinkResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +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 VirtualMachineScaleSetsClient. */ +public final class VirtualMachineScaleSetsClientImpl implements VirtualMachineScaleSetsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineScaleSetsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetsClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualMachineScaleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineScaleSets to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineScaleSetsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @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.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("forceDeletion") Boolean forceDeletion, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ExpandTypesForGetVMScaleSets expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/delete") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteInstances( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("forceDeletion") Boolean forceDeletion, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOSUpgradeHistory( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("skipShutdown") Boolean skipShutdown, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> redeploy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> performMaintenance( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateInstances( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimageAll( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalk( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("platformUpdateDomain") int platformUpdateDomain, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> convertToSinglePlacementGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setOrchestrationServiceState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OrchestrationServiceStateInput parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @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> listSkusNext( + @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> getOSUpgradeHistoryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + location, + apiVersion, + 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())); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync( + String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class, + Context.NONE); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class, + context); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetInner> beginUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class, + Context.NONE); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineScaleSetInner> beginUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class, + context); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).getSyncPoller(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + return updateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters The scale set object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, forceDeletion); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, forceDeletion, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).getSyncPoller(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion, context).getSyncPoller(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean forceDeletion = null; + return beginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmScaleSetName, forceDeletion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, Boolean forceDeletion) { + deleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).block(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmScaleSetName) { + final Boolean forceDeletion = null; + deleteAsync(resourceGroupName, vmScaleSetName, forceDeletion).block(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, forceDeletion, context).block(); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { + final ExpandTypesForGetVMScaleSets expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName) { + final ExpandTypesForGetVMScaleSets expand = null; + return getByResourceGroupAsync(resourceGroupName, vmScaleSetName, expand).block(); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, expand, context).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginDeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + deallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs == null) { + return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); + } else { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs == null) { + return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); + } else { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion) + .getSyncPoller(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context) + .getSyncPoller(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + final Boolean forceDeletion = null; + return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + deleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + final Boolean forceDeletion = null; + deleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + deleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context).block(); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, 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())); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + 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())); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkus( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync(String resourceGroupName, String vmScaleSetName) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName), + nextLink -> listSkusNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName, context), + nextLink -> listSkusNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus(String resourceGroupName, String vmScaleSetName) { + return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName, context)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSUpgradeHistorySinglePageAsync( + String resourceGroupName, String vmScaleSetName) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSUpgradeHistory( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + 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())); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSUpgradeHistorySinglePageAsync( + String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSUpgradeHistory( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getOSUpgradeHistoryAsync( + String resourceGroupName, String vmScaleSetName) { + return new PagedFlux<>( + () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName), + nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getOSUpgradeHistoryAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedFlux<>( + () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName, context), + nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName) { + return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName, context)); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).getSyncPoller(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context) + .getSyncPoller(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String vmScaleSetName) { + final Boolean skipShutdown = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).block(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String vmScaleSetName) { + final Boolean skipShutdown = null; + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs).block(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context).block(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginRestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + restartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginStartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + startAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginRedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + redeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 performMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateInstancesWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs == null) { + return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); + } else { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateInstancesWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs == null) { + return Mono.error(new IllegalArgumentException("Parameter vmInstanceIDs is required and cannot be null.")); + } else { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateInstancesAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateInstancesAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateInstancesAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + updateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + updateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmScaleSetReimageInput != null) { + vmScaleSetReimageInput.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmScaleSetReimageInput != null) { + vmScaleSetReimageInput.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + context); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).getSyncPoller(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageAllWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmInstanceIDs != null) { + vmInstanceIDs.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAllAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAllAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).getSyncPoller(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).getSyncPoller(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAllAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAllAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + return beginReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageAll( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageAll(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; + reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs).block(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + reimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, context).block(); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + platformUpdateDomain, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, 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 (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + platformUpdateDomain, + accept, + context); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain) + .block(); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain, context) + .block(); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> convertToSinglePlacementGroupWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .convertToSinglePlacementGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> convertToSinglePlacementGroupWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .convertToSinglePlacementGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono convertToSinglePlacementGroupAsync( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + convertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context) { + return convertToSinglePlacementGroupWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context) + .block(); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setOrchestrationServiceStateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .setOrchestrationServiceState( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setOrchestrationServiceStateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .setOrchestrationServiceState( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginSetOrchestrationServiceStateAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + Mono>> mono = + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginSetOrchestrationServiceStateAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSetOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) + .getSyncPoller(); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setOrchestrationServiceStateAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setOrchestrationServiceStateAsync( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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.listByLocationNext(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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync( + 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 + .listByLocationNext(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 the List Virtual Machine operation response. + */ + @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 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 List Virtual Machine operation response. + */ + @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)); + } + + /** + * 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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync( + 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 + .listAllNext(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 the Virtual Machine Scale Set List Skus operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync(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.listSkusNext(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 the Virtual Machine Scale Set List Skus operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync( + 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 + .listSkusNext(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 Virtual Machine Scale Set OS Upgrade History operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSUpgradeHistoryNextSinglePageAsync( + 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.getOSUpgradeHistoryNext(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 Virtual Machine Scale Set OS Upgrade History operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSUpgradeHistoryNextSinglePageAsync( + 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 + .getOSUpgradeHistoryNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java new file mode 100644 index 0000000000000..02e033fc2cb9e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetVMScaleSets; +import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput; +import com.azure.resourcemanager.compute.generated.models.RecoveryWalkResponse; +import com.azure.resourcemanager.compute.generated.models.UpgradeOperationHistoricalStatusInfo; +import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetSku; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetsImpl.class); + + private final VirtualMachineScaleSetsClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineScaleSetsImpl( + VirtualMachineScaleSetsClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String vmScaleSetName, Boolean forceDeletion) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, forceDeletion); + } + + public void delete(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName); + } + + public void delete(String resourceGroupName, String vmScaleSetName, Boolean forceDeletion, Context context) { + this.serviceClient().delete(resourceGroupName, vmScaleSetName, forceDeletion, context); + } + + public VirtualMachineScaleSet getByResourceGroup(String resourceGroupName, String vmScaleSetName) { + VirtualMachineScaleSetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vmScaleSetName); + if (inner != null) { + return new VirtualMachineScaleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deallocate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void deallocate(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName); + } + + public void deallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().deallocate(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion) { + this.serviceClient().deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion); + } + + public void deleteInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + this.serviceClient().deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context) { + this.serviceClient().deleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, forceDeletion, context); + } + + public VirtualMachineScaleSetInstanceView getInstanceView(String resourceGroupName, String vmScaleSetName) { + VirtualMachineScaleSetInstanceViewInner inner = + this.serviceClient().getInstanceView(resourceGroupName, vmScaleSetName); + if (inner != null) { + return new VirtualMachineScaleSetInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, Context context) { + Response inner = + this.serviceClient().getInstanceViewWithResponse(resourceGroupName, vmScaleSetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineScaleSetInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable listSkus(String resourceGroupName, String vmScaleSetName) { + PagedIterable inner = + this.serviceClient().listSkus(resourceGroupName, vmScaleSetName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetSkuImpl(inner1, this.manager())); + } + + public PagedIterable listSkus( + String resourceGroupName, String vmScaleSetName, Context context) { + PagedIterable inner = + this.serviceClient().listSkus(resourceGroupName, vmScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineScaleSetSkuImpl(inner1, this.manager())); + } + + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName) { + PagedIterable inner = + this.serviceClient().getOSUpgradeHistory(resourceGroupName, vmScaleSetName); + return Utils.mapPage(inner, inner1 -> new UpgradeOperationHistoricalStatusInfoImpl(inner1, this.manager())); + } + + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName, Context context) { + PagedIterable inner = + this.serviceClient().getOSUpgradeHistory(resourceGroupName, vmScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new UpgradeOperationHistoricalStatusInfoImpl(inner1, this.manager())); + } + + public void powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs); + } + + public void powerOff(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName); + } + + public void powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().powerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceIDs, context); + } + + public void restart( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().restart(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void restart(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().restart(resourceGroupName, vmScaleSetName); + } + + public void restart( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().restart(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void start( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().start(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void start(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().start(resourceGroupName, vmScaleSetName); + } + + public void start( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().start(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void redeploy( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void redeploy(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().redeploy(resourceGroupName, vmScaleSetName); + } + + public void redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().performMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void performMaintenance(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().performMaintenance(resourceGroupName, vmScaleSetName); + } + + public void performMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().performMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void updateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs) { + this.serviceClient().updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void updateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context) { + this.serviceClient().updateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public void reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + } + + public void reimage(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName); + } + + public void reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + this.serviceClient().reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); + } + + public void reimageAll( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs); + } + + public void reimageAll(String resourceGroupName, String vmScaleSetName) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName); + } + + public void reimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context) { + this.serviceClient().reimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs, context); + } + + public RecoveryWalkResponse forceRecoveryServiceFabricPlatformUpdateDomainWalk( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + RecoveryWalkResponseInner inner = + this + .serviceClient() + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + resourceGroupName, vmScaleSetName, platformUpdateDomain); + if (inner != null) { + return new RecoveryWalkResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { + Response inner = + this + .serviceClient() + .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + resourceGroupName, vmScaleSetName, platformUpdateDomain, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryWalkResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters) { + this.serviceClient().convertToSinglePlacementGroup(resourceGroupName, vmScaleSetName, parameters); + } + + public Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context) { + return this + .serviceClient() + .convertToSinglePlacementGroupWithResponse(resourceGroupName, vmScaleSetName, parameters, context); + } + + public void setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + this.serviceClient().setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters); + } + + public void setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + this.serviceClient().setOrchestrationServiceState(resourceGroupName, vmScaleSetName, parameters, context); + } + + public VirtualMachineScaleSet 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + ExpandTypesForGetVMScaleSets localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, ExpandTypesForGetVMScaleSets expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, expand, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + Boolean localForceDeletion = null; + this.delete(resourceGroupName, vmScaleSetName, localForceDeletion, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDeletion, 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 vmScaleSetName = Utils.getValueFromIdByName(id, "virtualMachineScaleSets"); + if (vmScaleSetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualMachineScaleSets'.", + id))); + } + this.delete(resourceGroupName, vmScaleSetName, forceDeletion, context); + } + + private VirtualMachineScaleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineScaleSetImpl define(String name) { + return new VirtualMachineScaleSetImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.java new file mode 100644 index 0000000000000..ced2bf309289c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizeImpl.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.compute.generated.implementation; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSize; + +public final class VirtualMachineSizeImpl implements VirtualMachineSize { + private VirtualMachineSizeInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineSizeImpl( + VirtualMachineSizeInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Integer numberOfCores() { + return this.innerModel().numberOfCores(); + } + + public Integer osDiskSizeInMB() { + return this.innerModel().osDiskSizeInMB(); + } + + public Integer resourceDiskSizeInMB() { + return this.innerModel().resourceDiskSizeInMB(); + } + + public Integer memoryInMB() { + return this.innerModel().memoryInMB(); + } + + public Integer maxDataDiskCount() { + return this.innerModel().maxDataDiskCount(); + } + + public VirtualMachineSizeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java new file mode 100644 index 0000000000000..f3c3b613f3289 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachineSizesClient. */ +public final class VirtualMachineSizesClientImpl implements VirtualMachineSizesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineSizesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachineSizesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineSizesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineSizesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachineSizes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachineSizesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, context)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesImpl.java new file mode 100644 index 0000000000000..2d99badbe91b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachineSizesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSize; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachineSizesImpl implements VirtualMachineSizes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSizesImpl.class); + + private final VirtualMachineSizesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachineSizesImpl( + VirtualMachineSizesClient innerClient, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + private VirtualMachineSizesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.java new file mode 100644 index 0000000000000..73142619bdff2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities; +import com.azure.resourcemanager.compute.generated.models.BillingProfile; +import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile; +import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile; +import com.azure.resourcemanager.compute.generated.models.HardwareProfile; +import com.azure.resourcemanager.compute.generated.models.NetworkProfile; +import com.azure.resourcemanager.compute.generated.models.OSProfile; +import com.azure.resourcemanager.compute.generated.models.Plan; +import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile; +import com.azure.resourcemanager.compute.generated.models.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineUpdate; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineUpdateImpl implements VirtualMachineUpdate { + private VirtualMachineUpdateInner innerObject; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + VirtualMachineUpdateImpl( + VirtualMachineUpdateInner innerObject, + com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public VirtualMachineIdentity identity() { + return this.innerModel().identity(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HardwareProfile hardwareProfile() { + return this.innerModel().hardwareProfile(); + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public AdditionalCapabilities additionalCapabilities() { + return this.innerModel().additionalCapabilities(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public DiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public SubResource availabilitySet() { + return this.innerModel().availabilitySet(); + } + + public SubResource virtualMachineScaleSet() { + return this.innerModel().virtualMachineScaleSet(); + } + + public SubResource proximityPlacementGroup() { + return this.innerModel().proximityPlacementGroup(); + } + + public VirtualMachinePriorityTypes priority() { + return this.innerModel().priority(); + } + + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.innerModel().evictionPolicy(); + } + + public BillingProfile billingProfile() { + return this.innerModel().billingProfile(); + } + + public SubResource host() { + return this.innerModel().host(); + } + + public SubResource hostGroup() { + return this.innerModel().hostGroup(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineInstanceView instanceView() { + VirtualMachineInstanceViewInner inner = this.innerModel().instanceView(); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public String licenseType() { + return this.innerModel().licenseType(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String extensionsTimeBudget() { + return this.innerModel().extensionsTimeBudget(); + } + + public Integer platformFaultDomain() { + return this.innerModel().platformFaultDomain(); + } + + public ScheduledEventsProfile scheduledEventsProfile() { + return this.innerModel().scheduledEventsProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public CapacityReservationProfile capacityReservation() { + return this.innerModel().capacityReservation(); + } + + public VirtualMachineUpdateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java new file mode 100644 index 0000000000000..bfd3fd1a3fb5e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,6283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.generated.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import com.azure.resourcemanager.compute.generated.models.ApiErrorException; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineListResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeListResult; +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 { + private final ClientLogger logger = new ClientLogger(VirtualMachinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachinesService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachinesClientImpl(ComputeManagementClientImpl client) { + this.service = + RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientVirtualMachines to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface VirtualMachinesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/capture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> capture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineCaptureParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineUpdateInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("forceDeletion") Boolean forceDeletion, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("$expand") InstanceViewTypes expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/instanceView") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> instanceView( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/convertToManagedDisks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> convertToManagedDisks( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/generalize") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generalize( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("statusOnly") String statusOnly, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/vmSizes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSizes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/powerOff") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("skipShutdown") Boolean skipShutdown, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/reapply") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> reapply( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> redeploy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineReimageParameters parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/retrieveBootDiagnosticsData") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> retrieveBootDiagnosticsData( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("sasUriExpirationTimeInMinutes") Integer sasUriExpirationTimeInMinutes, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/performMaintenance") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> performMaintenance( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/simulateEviction") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> simulateEviction( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/assessPatches") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> assessPatches( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/installPatches") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> installPatches( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualMachineInstallPatchesParameters installPatchesInput, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachines/{vmName}/runCommand") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runCommand( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vmName") String vmName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RunCommandInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + location, + apiVersion, + 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())); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> captureWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .capture( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> captureWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .capture( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineCaptureResultInner> + beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + Mono>> mono = captureWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineCaptureResultInner.class, + VirtualMachineCaptureResultInner.class, + Context.NONE); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineCaptureResultInner> + beginCaptureAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + captureWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineCaptureResultInner.class, + VirtualMachineCaptureResultInner.class, + context); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + return beginCaptureAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return beginCaptureAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono captureAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + return beginCaptureAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono captureAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return beginCaptureAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineCaptureResultInner capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + return captureAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineCaptureResultInner capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return captureAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + Context.NONE); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return createOrUpdateAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * The operation to create or update a virtual machine. Please note some properties can be set only during virtual + * machine creation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner createOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInner> beginUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + Context.NONE); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInner> beginUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + return beginUpdateAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + return beginUpdateAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + return updateAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner update( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return updateAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, Boolean forceDeletion) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, Boolean forceDeletion, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, Boolean forceDeletion) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmName, forceDeletion, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmName, forceDeletion).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, forceDeletion, context).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { + return beginDeleteAsync(resourceGroupName, vmName, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName) { + final Boolean forceDeletion = null; + return beginDeleteAsync(resourceGroupName, vmName, forceDeletion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + return beginDeleteAsync(resourceGroupName, vmName, forceDeletion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmName, Boolean forceDeletion) { + deleteAsync(resourceGroupName, vmName, forceDeletion).block(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmName) { + final Boolean forceDeletion = null; + deleteAsync(resourceGroupName, vmName, forceDeletion).block(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmName, Boolean forceDeletion, Context context) { + deleteAsync(resourceGroupName, vmName, forceDeletion, context).block(); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vmName) { + final InstanceViewTypes expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) { + final InstanceViewTypes expand = null; + return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand, context).block(); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> instanceViewWithResponseAsync( + String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .instanceView( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> instanceViewWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .instanceView( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono instanceViewAsync(String resourceGroupName, String vmName) { + return instanceViewWithResponseAsync(resourceGroupName, vmName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName) { + return instanceViewAsync(resourceGroupName, vmName).block(); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response instanceViewWithResponse( + String resourceGroupName, String vmName, Context context) { + return instanceViewWithResponseAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> convertToManagedDisksWithResponseAsync( + String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> convertToManagedDisksWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginConvertToManagedDisksAsync( + String resourceGroupName, String vmName) { + Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginConvertToManagedDisksAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + convertToManagedDisksWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName) { + return beginConvertToManagedDisksAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginConvertToManagedDisks( + String resourceGroupName, String vmName, Context context) { + return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { + return beginConvertToManagedDisksAsync(resourceGroupName, vmName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono convertToManagedDisksAsync(String resourceGroupName, String vmName, Context context) { + return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void convertToManagedDisks(String resourceGroupName, String vmName) { + convertToManagedDisksAsync(resourceGroupName, vmName).block(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void convertToManagedDisks(String resourceGroupName, String vmName, Context context) { + convertToManagedDisksAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String vmName) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeallocateAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate(String resourceGroupName, String vmName) { + return beginDeallocateAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeallocate( + String resourceGroupName, String vmName, Context context) { + return beginDeallocateAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmName) { + return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String vmName, Context context) { + return beginDeallocateAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmName) { + deallocateAsync(resourceGroupName, vmName).block(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmName, Context context) { + deallocateAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generalizeAsync(String resourceGroupName, String vmName) { + return generalizeWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generalize(String resourceGroupName, String vmName) { + generalizeAsync(resourceGroupName, vmName).block(); + } + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generalizeWithResponse(String resourceGroupName, String vmName, Context context) { + return generalizeWithResponseAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @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 (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.")); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String statusOnly) { + 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + statusOnly, + 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 machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String statusOnly, 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), statusOnly, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String statusOnly) { + return new PagedFlux<>(() -> listSinglePageAsync(statusOnly), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String statusOnly = null; + return new PagedFlux<>(() -> listSinglePageAsync(statusOnly), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String statusOnly, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(statusOnly, context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String statusOnly = null; + return new PagedIterable<>(listAsync(statusOnly)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String statusOnly, Context context) { + return new PagedIterable<>(listAsync(statusOnly, context)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync(String resourceGroupName, String vmName) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSizesAsync( + String resourceGroupName, String vmName, Context context) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName, context)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes(String resourceGroupName, String vmName) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String vmName, Context context) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName, context)); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmName, Boolean skipShutdown) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmName, Boolean skipShutdown, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String vmName, Boolean skipShutdown) { + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPowerOffAsync( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown) { + return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown).getSyncPoller(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context).getSyncPoller(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { + return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { + powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + powerOffAsync(resourceGroupName, vmName, skipShutdown, context).block(); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reapplyWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reapplyWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReapplyAsync(String resourceGroupName, String vmName) { + Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReapplyAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = reapplyWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName) { + return beginReapplyAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReapply(String resourceGroupName, String vmName, Context context) { + return beginReapplyAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reapplyAsync(String resourceGroupName, String vmName) { + return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reapplyAsync(String resourceGroupName, String vmName, Context context) { + return beginReapplyAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reapply(String resourceGroupName, String vmName) { + reapplyAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 reapply(String resourceGroupName, String vmName, Context context) { + reapplyAsync(resourceGroupName, vmName, context).block(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String vmName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName) { + return beginRestartAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart(String resourceGroupName, String vmName, Context context) { + return beginRestartAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String vmName) { + return beginRestartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String vmName, Context context) { + return beginRestartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmName) { + restartAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmName, Context context) { + restartAsync(resourceGroupName, vmName, context).block(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String vmName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String resourceGroupName, String vmName) { + return beginStartAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String resourceGroupName, String vmName, Context context) { + return beginStartAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String vmName) { + return beginStartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String vmName, Context context) { + return beginStartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmName) { + startAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmName, Context context) { + startAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync(String resourceGroupName, String vmName) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName) { + return beginRedeployAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRedeploy(String resourceGroupName, String vmName, Context context) { + return beginRedeployAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String vmName) { + return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono redeployAsync(String resourceGroupName, String vmName, Context context) { + return beginRedeployAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmName) { + redeployAsync(resourceGroupName, vmName).block(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmName, Context context) { + redeployAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + return beginReimageAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + return beginReimageAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + return beginReimageAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync(String resourceGroupName, String vmName) { + final VirtualMachineReimageParameters parameters = null; + return beginReimageAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + return beginReimageAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + reimageAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String vmName) { + final VirtualMachineReimageParameters parameters = null; + reimageAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + reimageAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> retrieveBootDiagnosticsDataWithResponseAsync( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmName, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> retrieveBootDiagnosticsDataWithResponseAsync( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmName, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes) { + return retrieveBootDiagnosticsDataWithResponseAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveBootDiagnosticsDataAsync( + String resourceGroupName, String vmName) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataWithResponseAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RetrieveBootDiagnosticsDataResultInner retrieveBootDiagnosticsData(String resourceGroupName, String vmName) { + final Integer sasUriExpirationTimeInMinutes = null; + return retrieveBootDiagnosticsDataAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes).block(); + } + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context) { + return retrieveBootDiagnosticsDataWithResponseAsync( + resourceGroupName, vmName, sasUriExpirationTimeInMinutes, context) + .block(); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPerformMaintenanceAsync( + String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance(String resourceGroupName, String vmName) { + return beginPerformMaintenanceAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPerformMaintenance( + String resourceGroupName, String vmName, Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync(String resourceGroupName, String vmName) { + return beginPerformMaintenanceAsync(resourceGroupName, vmName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono performMaintenanceAsync(String resourceGroupName, String vmName, Context context) { + return beginPerformMaintenanceAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance(String resourceGroupName, String vmName) { + performMaintenanceAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance(String resourceGroupName, String vmName, Context context) { + performMaintenanceAsync(resourceGroupName, vmName, context).block(); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> simulateEvictionWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> simulateEvictionWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + context = this.client.mergeContext(context); + return service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono simulateEvictionAsync(String resourceGroupName, String vmName) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void simulateEviction(String resourceGroupName, String vmName) { + simulateEvictionAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context) { + return simulateEvictionWithResponseAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> assessPatchesWithResponseAsync(String resourceGroupName, String vmName) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assessPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> assessPatchesWithResponseAsync( + String resourceGroupName, String vmName, 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .assessPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineAssessPatchesResultInner> + beginAssessPatchesAsync(String resourceGroupName, String vmName) { + Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineAssessPatchesResultInner.class, + VirtualMachineAssessPatchesResultInner.class, + Context.NONE); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineAssessPatchesResultInner> + beginAssessPatchesAsync(String resourceGroupName, String vmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = assessPatchesWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineAssessPatchesResultInner.class, + VirtualMachineAssessPatchesResultInner.class, + context); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName) { + return beginAssessPatchesAsync(resourceGroupName, vmName).getSyncPoller(); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineAssessPatchesResultInner> + beginAssessPatches(String resourceGroupName, String vmName, Context context) { + return beginAssessPatchesAsync(resourceGroupName, vmName, context).getSyncPoller(); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assessPatchesAsync(String resourceGroupName, String vmName) { + return beginAssessPatchesAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assessPatchesAsync( + String resourceGroupName, String vmName, Context context) { + return beginAssessPatchesAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineAssessPatchesResultInner assessPatches(String resourceGroupName, String vmName) { + return assessPatchesAsync(resourceGroupName, vmName).block(); + } + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineAssessPatchesResultInner assessPatches( + String resourceGroupName, String vmName, Context context) { + return assessPatchesAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> installPatchesWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 (installPatchesInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); + } else { + installPatchesInput.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .installPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + installPatchesInput, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> installPatchesWithResponseAsync( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + 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 (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 (installPatchesInput == null) { + return Mono + .error(new IllegalArgumentException("Parameter installPatchesInput is required and cannot be null.")); + } else { + installPatchesInput.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .installPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + installPatchesInput, + accept, + context); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInstallPatchesResultInner> + beginInstallPatchesAsync( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + Mono>> mono = + installPatchesWithResponseAsync(resourceGroupName, vmName, installPatchesInput); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstallPatchesResultInner.class, + VirtualMachineInstallPatchesResultInner.class, + Context.NONE); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VirtualMachineInstallPatchesResultInner> + beginInstallPatchesAsync( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + installPatchesWithResponseAsync(resourceGroupName, vmName, installPatchesInput, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInstallPatchesResultInner.class, + VirtualMachineInstallPatchesResultInner.class, + context); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + return beginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput).getSyncPoller(); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VirtualMachineInstallPatchesResultInner> + beginInstallPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + return beginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput, context).getSyncPoller(); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installPatchesAsync( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + return beginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installPatchesAsync( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + return beginInstallPatchesAsync(resourceGroupName, vmName, installPatchesInput, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstallPatchesResultInner installPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + return installPatchesAsync(resourceGroupName, vmName, installPatchesInput).block(); + } + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstallPatchesResultInner installPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + return installPatchesAsync(resourceGroupName, vmName, installPatchesInput, context).block(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, String vmName, RunCommandInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-04-01"; + final String accept = "application/json, text/json"; + context = this.client.mergeContext(context); + return service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, String vmName, RunCommandInput parameters) { + Mono>> mono = runCommandWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RunCommandResultInner.class, + RunCommandResultInner.class, + Context.NONE); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, context); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters) { + return beginRunCommandAsync(resourceGroupName, vmName, parameters).getSyncPoller(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return beginRunCommandAsync(resourceGroupName, vmName, parameters, context).getSyncPoller(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, String vmName, RunCommandInput parameters) { + return beginRunCommandAsync(resourceGroupName, vmName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return beginRunCommandAsync(resourceGroupName, vmName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { + return runCommandAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return runCommandAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * 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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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.listByLocationNext(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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync( + 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 + .listByLocationNext(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 the List Virtual Machine operation response. + */ + @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 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 List Virtual Machine operation response. + */ + @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)); + } + + /** + * 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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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.listAllNext(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 the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(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 + .listAllNext(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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesImpl.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesImpl.java new file mode 100644 index 0000000000000..3897ed2aee013 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesImpl.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes; +import com.azure.resourcemanager.compute.generated.models.RetrieveBootDiagnosticsDataResult; +import com.azure.resourcemanager.compute.generated.models.RunCommandInput; +import com.azure.resourcemanager.compute.generated.models.RunCommandResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineAssessPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesResult; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineSize; +import com.azure.resourcemanager.compute.generated.models.VirtualMachines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachinesImpl implements VirtualMachines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); + + private final VirtualMachinesClient innerClient; + + private final com.azure.resourcemanager.compute.generated.ComputeManager serviceManager; + + public VirtualMachinesImpl( + VirtualMachinesClient innerClient, com.azure.resourcemanager.compute.generated.ComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public VirtualMachineCaptureResult capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + VirtualMachineCaptureResultInner inner = this.serviceClient().capture(resourceGroupName, vmName, parameters); + if (inner != null) { + return new VirtualMachineCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineCaptureResult capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + VirtualMachineCaptureResultInner inner = + this.serviceClient().capture(resourceGroupName, vmName, parameters, context); + if (inner != null) { + return new VirtualMachineCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vmName, Boolean forceDeletion) { + this.serviceClient().delete(resourceGroupName, vmName, forceDeletion); + } + + public void delete(String resourceGroupName, String vmName) { + this.serviceClient().delete(resourceGroupName, vmName); + } + + public void delete(String resourceGroupName, String vmName, Boolean forceDeletion, Context context) { + this.serviceClient().delete(resourceGroupName, vmName, forceDeletion, context); + } + + public VirtualMachine getByResourceGroup(String resourceGroupName, String vmName) { + VirtualMachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vmName); + if (inner != null) { + return new VirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineInstanceView instanceView(String resourceGroupName, String vmName) { + VirtualMachineInstanceViewInner inner = this.serviceClient().instanceView(resourceGroupName, vmName); + if (inner != null) { + return new VirtualMachineInstanceViewImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response instanceViewWithResponse( + String resourceGroupName, String vmName, Context context) { + Response inner = + this.serviceClient().instanceViewWithResponse(resourceGroupName, vmName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineInstanceViewImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void convertToManagedDisks(String resourceGroupName, String vmName) { + this.serviceClient().convertToManagedDisks(resourceGroupName, vmName); + } + + public void convertToManagedDisks(String resourceGroupName, String vmName, Context context) { + this.serviceClient().convertToManagedDisks(resourceGroupName, vmName, context); + } + + public void deallocate(String resourceGroupName, String vmName) { + this.serviceClient().deallocate(resourceGroupName, vmName); + } + + public void deallocate(String resourceGroupName, String vmName, Context context) { + this.serviceClient().deallocate(resourceGroupName, vmName, context); + } + + public void generalize(String resourceGroupName, String vmName) { + this.serviceClient().generalize(resourceGroupName, vmName); + } + + public Response generalizeWithResponse(String resourceGroupName, String vmName, Context context) { + return this.serviceClient().generalizeWithResponse(resourceGroupName, vmName, 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(String statusOnly, Context context) { + PagedIterable inner = this.serviceClient().list(statusOnly, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSizes(String resourceGroupName, String vmName) { + PagedIterable inner = + this.serviceClient().listAvailableSizes(resourceGroupName, vmName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSizes( + String resourceGroupName, String vmName, Context context) { + PagedIterable inner = + this.serviceClient().listAvailableSizes(resourceGroupName, vmName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineSizeImpl(inner1, this.manager())); + } + + public void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { + this.serviceClient().powerOff(resourceGroupName, vmName, skipShutdown); + } + + public void powerOff(String resourceGroupName, String vmName) { + this.serviceClient().powerOff(resourceGroupName, vmName); + } + + public void powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + this.serviceClient().powerOff(resourceGroupName, vmName, skipShutdown, context); + } + + public void reapply(String resourceGroupName, String vmName) { + this.serviceClient().reapply(resourceGroupName, vmName); + } + + public void reapply(String resourceGroupName, String vmName, Context context) { + this.serviceClient().reapply(resourceGroupName, vmName, context); + } + + public void restart(String resourceGroupName, String vmName) { + this.serviceClient().restart(resourceGroupName, vmName); + } + + public void restart(String resourceGroupName, String vmName, Context context) { + this.serviceClient().restart(resourceGroupName, vmName, context); + } + + public void start(String resourceGroupName, String vmName) { + this.serviceClient().start(resourceGroupName, vmName); + } + + public void start(String resourceGroupName, String vmName, Context context) { + this.serviceClient().start(resourceGroupName, vmName, context); + } + + public void redeploy(String resourceGroupName, String vmName) { + this.serviceClient().redeploy(resourceGroupName, vmName); + } + + public void redeploy(String resourceGroupName, String vmName, Context context) { + this.serviceClient().redeploy(resourceGroupName, vmName, context); + } + + public void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters) { + this.serviceClient().reimage(resourceGroupName, vmName, parameters); + } + + public void reimage(String resourceGroupName, String vmName) { + this.serviceClient().reimage(resourceGroupName, vmName); + } + + public void reimage( + String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context) { + this.serviceClient().reimage(resourceGroupName, vmName, parameters, context); + } + + public RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData(String resourceGroupName, String vmName) { + RetrieveBootDiagnosticsDataResultInner inner = + this.serviceClient().retrieveBootDiagnosticsData(resourceGroupName, vmName); + if (inner != null) { + return new RetrieveBootDiagnosticsDataResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context) { + Response inner = + this + .serviceClient() + .retrieveBootDiagnosticsDataWithResponse( + resourceGroupName, vmName, sasUriExpirationTimeInMinutes, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RetrieveBootDiagnosticsDataResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void performMaintenance(String resourceGroupName, String vmName) { + this.serviceClient().performMaintenance(resourceGroupName, vmName); + } + + public void performMaintenance(String resourceGroupName, String vmName, Context context) { + this.serviceClient().performMaintenance(resourceGroupName, vmName, context); + } + + public void simulateEviction(String resourceGroupName, String vmName) { + this.serviceClient().simulateEviction(resourceGroupName, vmName); + } + + public Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context) { + return this.serviceClient().simulateEvictionWithResponse(resourceGroupName, vmName, context); + } + + public VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String vmName) { + VirtualMachineAssessPatchesResultInner inner = this.serviceClient().assessPatches(resourceGroupName, vmName); + if (inner != null) { + return new VirtualMachineAssessPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String vmName, Context context) { + VirtualMachineAssessPatchesResultInner inner = + this.serviceClient().assessPatches(resourceGroupName, vmName, context); + if (inner != null) { + return new VirtualMachineAssessPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstallPatchesResult installPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput) { + VirtualMachineInstallPatchesResultInner inner = + this.serviceClient().installPatches(resourceGroupName, vmName, installPatchesInput); + if (inner != null) { + return new VirtualMachineInstallPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstallPatchesResult installPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context) { + VirtualMachineInstallPatchesResultInner inner = + this.serviceClient().installPatches(resourceGroupName, vmName, installPatchesInput, context); + if (inner != null) { + return new VirtualMachineInstallPatchesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { + RunCommandResultInner inner = this.serviceClient().runCommand(resourceGroupName, vmName, parameters); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult runCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + RunCommandResultInner inner = this.serviceClient().runCommand(resourceGroupName, vmName, parameters, context); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + InstanceViewTypes localExpand = null; + return this.getByResourceGroupWithResponse(resourceGroupName, vmName, localExpand, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, InstanceViewTypes expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vmName, expand, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + Boolean localForceDeletion = null; + this.delete(resourceGroupName, vmName, localForceDeletion, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDeletion, 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 vmName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (vmName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + this.delete(resourceGroupName, vmName, forceDeletion, context); + } + + private VirtualMachinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.compute.generated.ComputeManager manager() { + return this.serviceManager; + } + + public VirtualMachineImpl define(String name) { + return new VirtualMachineImpl(name, this.manager()); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/package-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/package-info.java new file mode 100644 index 0000000000000..8568e6069f5c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ComputeManagementClient. Compute Client. */ +package com.azure.resourcemanager.compute.generated.implementation; diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessLevel.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessLevel.java new file mode 100644 index 0000000000000..6edbbea1fea15 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessLevel.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessLevel. */ +public final class AccessLevel extends ExpandableStringEnum { + /** Static value None for AccessLevel. */ + public static final AccessLevel NONE = fromString("None"); + + /** Static value Read for AccessLevel. */ + public static final AccessLevel READ = fromString("Read"); + + /** Static value Write for AccessLevel. */ + public static final AccessLevel WRITE = fromString("Write"); + + /** + * Creates or finds a AccessLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessLevel. + */ + @JsonCreator + public static AccessLevel fromString(String name) { + return fromString(name, AccessLevel.class); + } + + /** @return known AccessLevel values. */ + public static Collection values() { + return values(AccessLevel.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessUri.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessUri.java new file mode 100644 index 0000000000000..df61f0fa2b5ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AccessUri.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner; + +/** An immutable client-side representation of AccessUri. */ +public interface AccessUri { + /** + * Gets the accessSas property: A SAS uri for accessing a disk. + * + * @return the accessSas value. + */ + String accessSas(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner object. + * + * @return the inner object. + */ + AccessUriInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalCapabilities.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalCapabilities.java new file mode 100644 index 0000000000000..fb9355343e153 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalCapabilities.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enables or disables a capability on the virtual machine or virtual machine scale set. */ +@Fluent +public final class AdditionalCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalCapabilities.class); + + /* + * The flag that enables or disables a capability to have one or more + * managed data disks with UltraSSD_LRS storage account type on the VM or + * VMSS. Managed disks with storage account type UltraSSD_LRS can be added + * to a virtual machine or virtual machine scale set only if this property + * is enabled. + */ + @JsonProperty(value = "ultraSSDEnabled") + private Boolean ultraSsdEnabled; + + /** + * Get the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type + * UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. + * + * @return the ultraSsdEnabled value. + */ + public Boolean ultraSsdEnabled() { + return this.ultraSsdEnabled; + } + + /** + * Set the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data + * disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type + * UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. + * + * @param ultraSsdEnabled the ultraSsdEnabled value to set. + * @return the AdditionalCapabilities object itself. + */ + public AdditionalCapabilities withUltraSsdEnabled(Boolean ultraSsdEnabled) { + this.ultraSsdEnabled = ultraSsdEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalUnattendContent.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalUnattendContent.java new file mode 100644 index 0000000000000..c0d8203413c04 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AdditionalUnattendContent.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by + * Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. + */ +@Fluent +public final class AdditionalUnattendContent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalUnattendContent.class); + + /* + * The pass name. Currently, the only allowable value is OobeSystem. + */ + @JsonProperty(value = "passName") + private PassNames passName; + + /* + * The component name. Currently, the only allowable value is + * Microsoft-Windows-Shell-Setup. + */ + @JsonProperty(value = "componentName") + private ComponentNames componentName; + + /* + * Specifies the name of the setting to which the content applies. Possible + * values are: FirstLogonCommands and AutoLogon. + */ + @JsonProperty(value = "settingName") + private SettingNames settingName; + + /* + * Specifies the XML formatted content that is added to the unattend.xml + * file for the specified path and component. The XML must be less than 4KB + * and must include the root element for the setting or feature that is + * being inserted. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the passName property: The pass name. Currently, the only allowable value is OobeSystem. + * + * @return the passName value. + */ + public PassNames passName() { + return this.passName; + } + + /** + * Set the passName property: The pass name. Currently, the only allowable value is OobeSystem. + * + * @param passName the passName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withPassName(PassNames passName) { + this.passName = passName; + return this; + } + + /** + * Get the componentName property: The component name. Currently, the only allowable value is + * Microsoft-Windows-Shell-Setup. + * + * @return the componentName value. + */ + public ComponentNames componentName() { + return this.componentName; + } + + /** + * Set the componentName property: The component name. Currently, the only allowable value is + * Microsoft-Windows-Shell-Setup. + * + * @param componentName the componentName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withComponentName(ComponentNames componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the settingName property: Specifies the name of the setting to which the content applies. Possible values + * are: FirstLogonCommands and AutoLogon. + * + * @return the settingName value. + */ + public SettingNames settingName() { + return this.settingName; + } + + /** + * Set the settingName property: Specifies the name of the setting to which the content applies. Possible values + * are: FirstLogonCommands and AutoLogon. + * + * @param settingName the settingName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withSettingName(SettingNames settingName) { + this.settingName = settingName; + return this; + } + + /** + * Get the content property: Specifies the XML formatted content that is added to the unattend.xml file for the + * specified path and component. The XML must be less than 4KB and must include the root element for the setting or + * feature that is being inserted. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Specifies the XML formatted content that is added to the unattend.xml file for the + * specified path and component. The XML must be less than 4KB and must include the root element for the setting or + * feature that is being inserted. + * + * @param content the content value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AggregatedReplicationState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AggregatedReplicationState.java new file mode 100644 index 0000000000000..28a82a6cd66f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AggregatedReplicationState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AggregatedReplicationState. */ +public final class AggregatedReplicationState extends ExpandableStringEnum { + /** Static value Unknown for AggregatedReplicationState. */ + public static final AggregatedReplicationState UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for AggregatedReplicationState. */ + public static final AggregatedReplicationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for AggregatedReplicationState. */ + public static final AggregatedReplicationState COMPLETED = fromString("Completed"); + + /** Static value Failed for AggregatedReplicationState. */ + public static final AggregatedReplicationState FAILED = fromString("Failed"); + + /** + * Creates or finds a AggregatedReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AggregatedReplicationState. + */ + @JsonCreator + public static AggregatedReplicationState fromString(String name) { + return fromString(name, AggregatedReplicationState.class); + } + + /** @return known AggregatedReplicationState values. */ + public static Collection values() { + return values(AggregatedReplicationState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiEntityReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiEntityReference.java new file mode 100644 index 0000000000000..b0ab4f0d9bcc8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiEntityReference.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The API entity reference. */ +@Fluent +public final class ApiEntityReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiEntityReference.class); + + /* + * The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param id the id value to set. + * @return the ApiEntityReference object itself. + */ + public ApiEntityReference 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiError.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiError.java new file mode 100644 index 0000000000000..4d7c6f9a558e4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiError.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An error response from the Compute service. */ +@Immutable +public final class ApiError extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiError.class); + + /* + * The Api inner error + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private InnerError innererror; + + /** + * Get the innererror property: The Api inner error. + * + * @return the innererror value. + */ + public InnerError getInnererror() { + return this.innererror; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (getInnererror() != null) { + getInnererror().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiErrorException.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiErrorException.java new file mode 100644 index 0000000000000..2f9905501fc05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ApiErrorException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with ApiError information. */ +public final class ApiErrorException extends ManagementException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ApiErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ApiErrorException(String message, HttpResponse response, ApiError value) { + super(message, response, value); + } + + @Override + public ApiError getValue() { + return (ApiError) super.getValue(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java new file mode 100644 index 0000000000000..e871ef45110b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradePolicy.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration parameters used for performing automatic OS upgrade. */ +@Fluent +public final class AutomaticOSUpgradePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticOSUpgradePolicy.class); + + /* + * Indicates whether OS upgrades should automatically be applied to scale + * set instances in a rolling fashion when a newer version of the OS image + * becomes available. Default value is false.

    If this is set to + * true for Windows based scale sets, + * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) + * is automatically set to false and cannot be set to true. + */ + @JsonProperty(value = "enableAutomaticOSUpgrade") + private Boolean enableAutomaticOSUpgrade; + + /* + * Whether OS image rollback feature should be disabled. Default value is + * false. + */ + @JsonProperty(value = "disableAutomaticRollback") + private Boolean disableAutomaticRollback; + + /** + * Get the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale + * set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is + * false. <br><br> If this is set to true for Windows based scale sets, + * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) + * is automatically set to false and cannot be set to true. + * + * @return the enableAutomaticOSUpgrade value. + */ + public Boolean enableAutomaticOSUpgrade() { + return this.enableAutomaticOSUpgrade; + } + + /** + * Set the enableAutomaticOSUpgrade property: Indicates whether OS upgrades should automatically be applied to scale + * set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is + * false. <br><br> If this is set to true for Windows based scale sets, + * [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) + * is automatically set to false and cannot be set to true. + * + * @param enableAutomaticOSUpgrade the enableAutomaticOSUpgrade value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withEnableAutomaticOSUpgrade(Boolean enableAutomaticOSUpgrade) { + this.enableAutomaticOSUpgrade = enableAutomaticOSUpgrade; + return this; + } + + /** + * Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is + * false. + * + * @return the disableAutomaticRollback value. + */ + public Boolean disableAutomaticRollback() { + return this.disableAutomaticRollback; + } + + /** + * Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. Default value is + * false. + * + * @param disableAutomaticRollback the disableAutomaticRollback value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withDisableAutomaticRollback(Boolean disableAutomaticRollback) { + this.disableAutomaticRollback = disableAutomaticRollback; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradeProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradeProperties.java new file mode 100644 index 0000000000000..e83f30268b9f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticOSUpgradeProperties.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes automatic OS upgrade properties on the image. */ +@Fluent +public final class AutomaticOSUpgradeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticOSUpgradeProperties.class); + + /* + * Specifies whether automatic OS upgrade is supported on the image. + */ + @JsonProperty(value = "automaticOSUpgradeSupported", required = true) + private boolean automaticOSUpgradeSupported; + + /** + * Get the automaticOSUpgradeSupported property: Specifies whether automatic OS upgrade is supported on the image. + * + * @return the automaticOSUpgradeSupported value. + */ + public boolean automaticOSUpgradeSupported() { + return this.automaticOSUpgradeSupported; + } + + /** + * Set the automaticOSUpgradeSupported property: Specifies whether automatic OS upgrade is supported on the image. + * + * @param automaticOSUpgradeSupported the automaticOSUpgradeSupported value to set. + * @return the AutomaticOSUpgradeProperties object itself. + */ + public AutomaticOSUpgradeProperties withAutomaticOSUpgradeSupported(boolean automaticOSUpgradeSupported) { + this.automaticOSUpgradeSupported = automaticOSUpgradeSupported; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.java new file mode 100644 index 0000000000000..a7eb78d443c94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AutomaticRepairsPolicy.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the configuration parameters for automatic repairs on the virtual machine scale set. */ +@Fluent +public final class AutomaticRepairsPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticRepairsPolicy.class); + + /* + * Specifies whether automatic repairs should be enabled on the virtual + * machine scale set. The default value is false. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The amount of time for which automatic repairs are suspended due to a + * state change on VM. The grace time starts after the state change has + * completed. This helps avoid premature or accidental repairs. The time + * duration should be specified in ISO 8601 format. The minimum allowed + * grace period is 30 minutes (PT30M), which is also the default value. The + * maximum allowed grace period is 90 minutes (PT90M). + */ + @JsonProperty(value = "gracePeriod") + private String gracePeriod; + + /** + * Get the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. + * The default value is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether automatic repairs should be enabled on the virtual machine scale set. + * The default value is false. + * + * @param enabled the enabled value to set. + * @return the AutomaticRepairsPolicy object itself. + */ + public AutomaticRepairsPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change + * on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental + * repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes + * (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). + * + * @return the gracePeriod value. + */ + public String gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the gracePeriod property: The amount of time for which automatic repairs are suspended due to a state change + * on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental + * repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes + * (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). + * + * @param gracePeriod the gracePeriod value to set. + * @return the AutomaticRepairsPolicy object itself. + */ + public AutomaticRepairsPolicy withGracePeriod(String gracePeriod) { + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java new file mode 100644 index 0000000000000..c287f7cf3483a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySet.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import java.util.List; +import java.util.Map; + +/** 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 sku property: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes + * for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual + * machines with unmanaged disks. Default value is 'Classic'. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the platformUpdateDomainCount property: Update Domain count. + * + * @return the platformUpdateDomainCount value. + */ + Integer platformUpdateDomainCount(); + + /** + * Gets the platformFaultDomainCount property: Fault Domain count. + * + * @return the platformFaultDomainCount value. + */ + Integer platformFaultDomainCount(); + + /** + * Gets the virtualMachines property: A list of references to all virtual machines in the availability set. + * + * @return the virtualMachines value. + */ + List virtualMachines(); + + /** + * Gets the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * 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.compute.generated.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 AvailabilitySet definition stages. */ + interface DefinitionStages { + /** The first stage of the AvailabilitySet definition. */ + interface Blank extends WithLocation { + } + /** 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. + */ + 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 AvailabilitySet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * 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.WithSku, + DefinitionStages.WithPlatformUpdateDomainCount, + DefinitionStages.WithPlatformFaultDomainCount, + DefinitionStages.WithVirtualMachines, + DefinitionStages.WithProximityPlacementGroup { + /** + * 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. */ + 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 sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the availability set, only name is required to be set. See + * AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks + * and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.. + * + * @param sku Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for + * possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for + * virtual machines with unmanaged disks. Default value is 'Classic'. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the AvailabilitySet definition allowing to specify platformUpdateDomainCount. */ + interface WithPlatformUpdateDomainCount { + /** + * Specifies the platformUpdateDomainCount property: Update Domain count.. + * + * @param platformUpdateDomainCount Update Domain count. + * @return the next definition stage. + */ + WithCreate withPlatformUpdateDomainCount(Integer platformUpdateDomainCount); + } + /** The stage of the AvailabilitySet definition allowing to specify platformFaultDomainCount. */ + interface WithPlatformFaultDomainCount { + /** + * Specifies the platformFaultDomainCount property: Fault Domain count.. + * + * @param platformFaultDomainCount Fault Domain count. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomainCount(Integer platformFaultDomainCount); + } + /** The stage of the AvailabilitySet definition allowing to specify virtualMachines. */ + interface WithVirtualMachines { + /** + * Specifies the virtualMachines property: A list of references to all virtual machines in the availability + * set.. + * + * @param virtualMachines A list of references to all virtual machines in the availability set. + * @return the next definition stage. + */ + WithCreate withVirtualMachines(List virtualMachines); + } + /** The stage of the AvailabilitySet definition allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + } + /** + * Begins update for the AvailabilitySet resource. + * + * @return the stage of resource update. + */ + AvailabilitySet.Update update(); + + /** The template for AvailabilitySet update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithPlatformUpdateDomainCount, + UpdateStages.WithPlatformFaultDomainCount, + UpdateStages.WithVirtualMachines, + UpdateStages.WithProximityPlacementGroup { + /** + * 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. */ + interface UpdateStages { + /** 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); + } + /** The stage of the AvailabilitySet update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the availability set. + * + * @param sku Sku of the availability set. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the AvailabilitySet update allowing to specify platformUpdateDomainCount. */ + interface WithPlatformUpdateDomainCount { + /** + * Specifies the platformUpdateDomainCount property: Update Domain count.. + * + * @param platformUpdateDomainCount Update Domain count. + * @return the next definition stage. + */ + Update withPlatformUpdateDomainCount(Integer platformUpdateDomainCount); + } + /** The stage of the AvailabilitySet update allowing to specify platformFaultDomainCount. */ + interface WithPlatformFaultDomainCount { + /** + * Specifies the platformFaultDomainCount property: Fault Domain count.. + * + * @param platformFaultDomainCount Fault Domain count. + * @return the next definition stage. + */ + Update withPlatformFaultDomainCount(Integer platformFaultDomainCount); + } + /** The stage of the AvailabilitySet update allowing to specify virtualMachines. */ + interface WithVirtualMachines { + /** + * Specifies the virtualMachines property: A list of references to all virtual machines in the availability + * set.. + * + * @param virtualMachines A list of references to all virtual machines in the availability set. + * @return the next definition stage. + */ + Update withVirtualMachines(List virtualMachines); + } + /** The stage of the AvailabilitySet update allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + Update withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + } + /** + * 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. + */ + AvailabilitySet refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.java new file mode 100644 index 0000000000000..80a3a420cfce1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Availability Set operation response. */ +@Fluent +public final class AvailabilitySetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetListResult.class); + + /* + * The list of availability sets + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of AvailabilitySets. Call ListNext() with + * this URI to fetch the next page of AvailabilitySets. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of availability sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of availability sets. + * + * @param value the value value to set. + * @return the AvailabilitySetListResult object itself. + */ + public AvailabilitySetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to + * fetch the next page of AvailabilitySets. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to + * fetch the next page of AvailabilitySets. + * + * @param nextLink the nextLink value to set. + * @return the AvailabilitySetListResult object itself. + */ + public AvailabilitySetListResult 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 AvailabilitySetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.java new file mode 100644 index 0000000000000..56a52ba8cb6f7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySetUpdate.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be + * updated. + */ +@JsonFlatten +@Fluent +public class AvailabilitySetUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetUpdate.class); + + /* + * Sku of the availability set + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Update Domain count. + */ + @JsonProperty(value = "properties.platformUpdateDomainCount") + private Integer platformUpdateDomainCount; + + /* + * Fault Domain count. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * A list of references to all virtual machines in the availability set. + */ + @JsonProperty(value = "properties.virtualMachines") + private List virtualMachines; + + /* + * Specifies information about the proximity placement group that the + * availability set should be assigned to.

    Minimum api-version: + * 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /* + * The resource status information. + */ + @JsonProperty(value = "properties.statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** + * Get the sku property: Sku of the availability set. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the availability set. + * + * @param sku the sku value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the platformUpdateDomainCount property: Update Domain count. + * + * @return the platformUpdateDomainCount value. + */ + public Integer platformUpdateDomainCount() { + return this.platformUpdateDomainCount; + } + + /** + * Set the platformUpdateDomainCount property: Update Domain count. + * + * @param platformUpdateDomainCount the platformUpdateDomainCount value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { + this.platformUpdateDomainCount = platformUpdateDomainCount; + return this; + } + + /** + * Get the platformFaultDomainCount property: Fault Domain count. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Fault Domain count. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get the virtualMachines property: A list of references to all virtual machines in the availability set. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: A list of references to all virtual machines in the availability set. + * + * @param virtualMachines the virtualMachines value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java new file mode 100644 index 0000000000000..7c29aba718ad0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailabilitySets.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 AvailabilitySets. */ +public interface AvailabilitySets { + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String availabilitySetName); + + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context); + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + AvailabilitySet getByResourceGroup(String resourceGroupName, String availabilitySetName); + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String availabilitySetName, Context context); + + /** + * Lists all availability sets 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 List Availability Set operation response. + */ + PagedIterable list(); + + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + PagedIterable list(String expand, Context context); + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all availability sets 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 the List Availability Set operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable listAvailableSizes(String resourceGroupName, String availabilitySetName); + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context); + + /** + * Retrieves information about an availability set. + * + * @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 specifies information about the availability set that the virtual machine should be assigned to. + */ + AvailabilitySet getById(String id); + + /** + * Retrieves information about an availability set. + * + * @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 specifies information about the availability set that the virtual machine should be assigned to. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an availability set. + * + * @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); + + /** + * Delete an availability set. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AvailabilitySet resource. + * + * @param name resource name. + * @return the first stage of the new AvailabilitySet definition. + */ + AvailabilitySet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java new file mode 100644 index 0000000000000..c3d158e90ea6c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/AvailablePatchSummary.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of an virtual machine instance view for available patch summary. */ +@Immutable +public final class AvailablePatchSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePatchSummary.class); + + /* + * The overall success or failure status of the operation. It remains + * "InProgress" until the operation completes. At that point it will become + * "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + */ + @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String assessmentActivityId; + + /* + * The overall reboot status of the VM. It will be true when partially + * installed patches require a reboot to complete installation but the + * reboot has not yet occurred. + */ + @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY) + private Boolean rebootPending; + + /* + * The number of critical or security patches that have been detected as + * available and not yet installed. + */ + @JsonProperty(value = "criticalAndSecurityPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer criticalAndSecurityPatchCount; + + /* + * The number of all available patches excluding critical and security. + */ + @JsonProperty(value = "otherPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer otherPatchCount; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The errors that were encountered during execution of the operation. The + * details array contains the list of them. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the assessmentActivityId property: The activity ID of the operation that produced this result. It is used to + * correlate across CRP and extension logs. + * + * @return the assessmentActivityId value. + */ + public String assessmentActivityId() { + return this.assessmentActivityId; + } + + /** + * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed + * patches require a reboot to complete installation but the reboot has not yet occurred. + * + * @return the rebootPending value. + */ + public Boolean rebootPending() { + return this.rebootPending; + } + + /** + * Get the criticalAndSecurityPatchCount property: The number of critical or security patches that have been + * detected as available and not yet installed. + * + * @return the criticalAndSecurityPatchCount value. + */ + public Integer criticalAndSecurityPatchCount() { + return this.criticalAndSecurityPatchCount; + } + + /** + * Get the otherPatchCount property: The number of all available patches excluding critical and security. + * + * @return the otherPatchCount value. + */ + public Integer otherPatchCount() { + return this.otherPatchCount; + } + + /** + * Get the startTime property: The UTC timestamp when the operation began. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the lastModifiedTime property: The UTC timestamp when the operation began. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.java new file mode 100644 index 0000000000000..df0927e3b349e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BillingProfile.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum api-version: + * 2019-03-01. + */ +@Fluent +public final class BillingProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfile.class); + + /* + * Specifies the maximum price you are willing to pay for a Azure Spot + * VM/VMSS. This price is in US Dollars.

    This price will be + * compared with the current Azure Spot price for the VM size. Also, the + * prices are compared at the time of create/update of Azure Spot VM/VMSS + * and the operation will only succeed if the maxPrice is greater than the + * current Azure Spot price.

    The maxPrice will also be used for + * evicting a Azure Spot VM/VMSS if the current Azure Spot price goes + * beyond the maxPrice after creation of VM/VMSS.

    Possible values + * are:

    - Any decimal value greater than zero. Example: 0.01538 + *

    -1 – indicates default price to be up-to on-demand.

    + * You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS + * should not be evicted for price reasons. Also, the default max price is + * -1 if it is not provided by you.

    Minimum api-version: + * 2019-03-01. + */ + @JsonProperty(value = "maxPrice") + private Double maxPrice; + + /** + * Get the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This + * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for + * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation + * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice + * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value + * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. + * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted + * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the maxPrice value. + */ + public Double maxPrice() { + return this.maxPrice; + } + + /** + * Set the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This + * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for + * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation + * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice + * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value + * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. + * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted + * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum + * api-version: 2019-03-01. + * + * @param maxPrice the maxPrice value to set. + * @return the BillingProfile object itself. + */ + public BillingProfile withMaxPrice(Double maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.java new file mode 100644 index 0000000000000..3c39ddeaf0e7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnostics.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. + * <br><br> You can easily view the output of your console log. <br><br> Azure also enables you + * to see a screenshot of the VM from the hypervisor. + */ +@Fluent +public final class BootDiagnostics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BootDiagnostics.class); + + /* + * Whether boot diagnostics should be enabled on the Virtual Machine. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Uri of the storage account to use for placing the console output and + * screenshot.

    If storageUri is not specified while enabling boot + * diagnostics, managed storage will be used. + */ + @JsonProperty(value = "storageUri") + private String storageUri; + + /** + * Get the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param enabled the enabled value to set. + * @return the BootDiagnostics object itself. + */ + public BootDiagnostics withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: Uri of the storage account to use for placing the console output and screenshot. + * <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @param storageUri the storageUri value to set. + * @return the BootDiagnostics object itself. + */ + public BootDiagnostics withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.java new file mode 100644 index 0000000000000..727504951eca4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/BootDiagnosticsInstanceView.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a virtual machine boot diagnostics. */ +@Immutable +public final class BootDiagnosticsInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BootDiagnosticsInstanceView.class); + + /* + * The console screenshot blob URI.

    NOTE: This will **not** be set + * if boot diagnostics is currently enabled with managed storage. + */ + @JsonProperty(value = "consoleScreenshotBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String consoleScreenshotBlobUri; + + /* + * The serial console log blob Uri.

    NOTE: This will **not** be set + * if boot diagnostics is currently enabled with managed storage. + */ + @JsonProperty(value = "serialConsoleLogBlobUri", access = JsonProperty.Access.WRITE_ONLY) + private String serialConsoleLogBlobUri; + + /* + * The boot diagnostics status information for the VM.

    NOTE: It + * will be set only if there are errors encountered in enabling boot + * diagnostics. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private InstanceViewStatus status; + + /** + * Get the consoleScreenshotBlobUri property: The console screenshot blob URI. <br><br>NOTE: This will + * **not** be set if boot diagnostics is currently enabled with managed storage. + * + * @return the consoleScreenshotBlobUri value. + */ + public String consoleScreenshotBlobUri() { + return this.consoleScreenshotBlobUri; + } + + /** + * Get the serialConsoleLogBlobUri property: The serial console log blob Uri. <br><br>NOTE: This will + * **not** be set if boot diagnostics is currently enabled with managed storage. + * + * @return the serialConsoleLogBlobUri value. + */ + public String serialConsoleLogBlobUri() { + return this.serialConsoleLogBlobUri; + } + + /** + * Get the status property: The boot diagnostics status information for the VM. <br><br> NOTE: It will + * be set only if there are errors encountered in enabling boot diagnostics. + * + * @return the status value. + */ + public InstanceViewStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.java new file mode 100644 index 0000000000000..04a6980073f1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CachingTypes.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for CachingTypes. */ +public enum CachingTypes { + /** Enum value None. */ + NONE("None"), + + /** Enum value ReadOnly. */ + READ_ONLY("ReadOnly"), + + /** Enum value ReadWrite. */ + READ_WRITE("ReadWrite"); + + /** The actual serialized value for a CachingTypes instance. */ + private final String value; + + CachingTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CachingTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed CachingTypes object, or null if unable to parse. + */ + @JsonCreator + public static CachingTypes fromString(String value) { + CachingTypes[] items = CachingTypes.values(); + for (CachingTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java new file mode 100644 index 0000000000000..883e505819742 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservation.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CapacityReservation. */ +public interface CapacityReservation { + /** + * 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 sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the zones property: Availability Zone to use for this capacity reservation. The zone has to be single value + * and also should be part for the list of zones specified during the capacity reservation group creation. The zone + * can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If + * provided, enforces VM/VMSS using this capacity reservation to be in same zone. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + String reservationId(); + + /** + * Gets the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + List virtualMachinesAssociated(); + + /** + * Gets the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + OffsetDateTime provisioningTime(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + CapacityReservationInstanceView instanceView(); + + /** + * 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.compute.generated.fluent.models.CapacityReservationInner object. + * + * @return the inner object. + */ + CapacityReservationInner innerModel(); + + /** The entirety of the CapacityReservation definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The CapacityReservation definition stages. */ + interface DefinitionStages { + /** The first stage of the CapacityReservation definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CapacityReservation definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the CapacityReservation definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, capacityReservationGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @return the next definition stage. + */ + WithSku withExistingCapacityReservationGroup(String resourceGroupName, String capacityReservationGroupName); + } + /** The stage of the CapacityReservation definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and + * capacity is required to be set. Currently VM Skus with the capability called + * 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a + * region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.. + * + * @param sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set + * to true are supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the CapacityReservation 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.WithZones { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapacityReservation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapacityReservation create(Context context); + } + /** The stage of the CapacityReservation 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 CapacityReservation definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zone to use for this capacity reservation. The zone has to be + * single value and also should be part for the list of zones specified during the capacity reservation + * group creation. The zone can be assigned only during creation. If not provided, the reservation supports + * only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same + * zone.. + * + * @param zones Availability Zone to use for this capacity reservation. The zone has to be single value and + * also should be part for the list of zones specified during the capacity reservation group creation. + * The zone can be assigned only during creation. If not provided, the reservation supports only + * non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same + * zone. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + } + /** + * Begins update for the CapacityReservation resource. + * + * @return the stage of resource update. + */ + CapacityReservation.Update update(); + + /** The template for CapacityReservation update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapacityReservation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapacityReservation apply(Context context); + } + /** The CapacityReservation update stages. */ + interface UpdateStages { + /** The stage of the CapacityReservation 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); + } + /** The stage of the CapacityReservation update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and + * capacity is required to be set. Currently VM Skus with the capability called + * 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a + * region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.. + * + * @param sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set + * to true are supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CapacityReservation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapacityReservation refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java new file mode 100644 index 0000000000000..25bd307e503b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroup.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CapacityReservationGroup. */ +public interface CapacityReservationGroup { + /** + * 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 zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If provided, + * enforces each capacity reservation in the group to be in one of the zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + List capacityReservations(); + + /** + * Gets the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + List virtualMachinesAssociated(); + + /** + * Gets the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + CapacityReservationGroupInstanceView instanceView(); + + /** + * 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.compute.generated.fluent.models.CapacityReservationGroupInner object. + * + * @return the inner object. + */ + CapacityReservationGroupInner innerModel(); + + /** The entirety of the CapacityReservationGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CapacityReservationGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the CapacityReservationGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CapacityReservationGroup 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 CapacityReservationGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CapacityReservationGroup 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.WithZones { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapacityReservationGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapacityReservationGroup create(Context context); + } + /** The stage of the CapacityReservationGroup 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 CapacityReservationGroup definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zones to use for this capacity reservation group. The zones + * can be assigned only during creation. If not provided, the group supports only regional resources in the + * region. If provided, enforces each capacity reservation in the group to be in one of the zones.. + * + * @param zones Availability Zones to use for this capacity reservation group. The zones can be assigned + * only during creation. If not provided, the group supports only regional resources in the region. If + * provided, enforces each capacity reservation in the group to be in one of the zones. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + } + /** + * Begins update for the CapacityReservationGroup resource. + * + * @return the stage of resource update. + */ + CapacityReservationGroup.Update update(); + + /** The template for CapacityReservationGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapacityReservationGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapacityReservationGroup apply(Context context); + } + /** The CapacityReservationGroup update stages. */ + interface UpdateStages { + /** The stage of the CapacityReservationGroup 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. + */ + CapacityReservationGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapacityReservationGroup refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java new file mode 100644 index 0000000000000..ace89bc8f19f1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceView.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CapacityReservationGroupInstanceView model. */ +@Immutable +public final class CapacityReservationGroupInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationGroupInstanceView.class); + + /* + * List of instance view of the capacity reservations under the capacity + * reservation group. + */ + @JsonProperty(value = "capacityReservations", access = JsonProperty.Access.WRITE_ONLY) + private List capacityReservations; + + /** + * Get the capacityReservations property: List of instance view of the capacity reservations under the capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.capacityReservations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityReservations() != null) { + capacityReservations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java new file mode 100644 index 0000000000000..7dea4bbe6ebf7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupInstanceViewTypes.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CapacityReservationGroupInstanceViewTypes. */ +public final class CapacityReservationGroupInstanceViewTypes + extends ExpandableStringEnum { + /** Static value instanceView for CapacityReservationGroupInstanceViewTypes. */ + public static final CapacityReservationGroupInstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates or finds a CapacityReservationGroupInstanceViewTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityReservationGroupInstanceViewTypes. + */ + @JsonCreator + public static CapacityReservationGroupInstanceViewTypes fromString(String name) { + return fromString(name, CapacityReservationGroupInstanceViewTypes.class); + } + + /** @return known CapacityReservationGroupInstanceViewTypes values. */ + public static Collection values() { + return values(CapacityReservationGroupInstanceViewTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java new file mode 100644 index 0000000000000..25bca7bf9784d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupListResult.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List capacity reservation group with resource group response. */ +@Fluent +public final class CapacityReservationGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationGroupListResult.class); + + /* + * The list of capacity reservation groups + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of capacity reservation groups. Call + * ListNext() with this URI to fetch the next page of capacity reservation + * groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of capacity reservation groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capacity reservation groups. + * + * @param value the value value to set. + * @return the CapacityReservationGroupListResult object itself. + */ + public CapacityReservationGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capacity reservation groups. Call ListNext() with + * this URI to fetch the next page of capacity reservation groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capacity reservation groups. Call ListNext() with + * this URI to fetch the next page of capacity reservation groups. + * + * @param nextLink the nextLink value to set. + * @return the CapacityReservationGroupListResult object itself. + */ + public CapacityReservationGroupListResult 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 CapacityReservationGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java new file mode 100644 index 0000000000000..781c0f733d845 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroupUpdate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation group. Only tags can be updated. */ +@JsonFlatten +@Fluent +public class CapacityReservationGroupUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationGroupUpdate.class); + + /* + * A list of all capacity reservation resource ids that belong to capacity + * reservation group. + */ + @JsonProperty(value = "properties.capacityReservations", access = JsonProperty.Access.WRITE_ONLY) + private List capacityReservations; + + /* + * A list of references to all virtual machines associated to the capacity + * reservation group. + */ + @JsonProperty(value = "properties.virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The capacity reservation group instance view which has the list of + * instance views for all the capacity reservations that belong to the + * capacity reservation group. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationGroupInstanceView instanceView; + + /** + * Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity + * reservation group. + * + * @return the capacityReservations value. + */ + public List capacityReservations() { + return this.capacityReservations; + } + + /** + * Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the + * capacity reservation group. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the instanceView property: The capacity reservation group instance view which has the list of instance views + * for all the capacity reservations that belong to the capacity reservation group. + * + * @return the instanceView value. + */ + public CapacityReservationGroupInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationGroupUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (capacityReservations() != null) { + capacityReservations().forEach(e -> e.validate()); + } + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java new file mode 100644 index 0000000000000..3c4f335759008 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationGroups.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 CapacityReservationGroups. */ +public interface CapacityReservationGroups { + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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. + */ + Response deleteWithResponse(String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + CapacityReservationGroup getByResourceGroup(String resourceGroupName, String capacityReservationGroupName); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + CapacityReservationGroupInstanceViewTypes expand, + Context context); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the + * response to get the next page of capacity reservation groups. + * + * @param resourceGroupName The name of the resource group. + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + PagedIterable list(); + + /** + * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to + * get the next page of capacity reservation groups. + * + * @param expand The expand expression to apply on the operation. Based on the expand param(s) specified we return + * Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation + * group in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List capacity reservation group with resource group response. + */ + PagedIterable list(ExpandTypesForGetCapacityReservationGroups expand, Context context); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + CapacityReservationGroup getById(String id); + + /** + * The operation that retrieves information about a capacity reservation group. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime + * properties of a capacity reservation that is managed by the platform and can change outside of control plane + * operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation group that the capacity reservations should be + * assigned to. + */ + Response getByIdWithResponse( + String id, CapacityReservationGroupInstanceViewTypes expand, Context context); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete a capacity reservation group. This operation is allowed only if all the associated + * resources are disassociated from the reservation group and all capacity reservations under the reservation group + * have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CapacityReservationGroup resource. + * + * @param name resource name. + * @return the first stage of the new CapacityReservationGroup definition. + */ + CapacityReservationGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.java new file mode 100644 index 0000000000000..5db7fa2e35bb0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceView.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity + * reservation that is managed by the platform and can change outside of control plane operations. + */ +@Fluent +public class CapacityReservationInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationInstanceView.class); + + /* + * Unutilized capacity of the capacity reservation. + */ + @JsonProperty(value = "utilizationInfo") + private CapacityReservationUtilization utilizationInfo; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the utilizationInfo property: Unutilized capacity of the capacity reservation. + * + * @return the utilizationInfo value. + */ + public CapacityReservationUtilization utilizationInfo() { + return this.utilizationInfo; + } + + /** + * Set the utilizationInfo property: Unutilized capacity of the capacity reservation. + * + * @param utilizationInfo the utilizationInfo value to set. + * @return the CapacityReservationInstanceView object itself. + */ + public CapacityReservationInstanceView withUtilizationInfo(CapacityReservationUtilization utilizationInfo) { + this.utilizationInfo = utilizationInfo; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the CapacityReservationInstanceView object itself. + */ + public CapacityReservationInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (utilizationInfo() != null) { + utilizationInfo().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java new file mode 100644 index 0000000000000..a66883e33a051 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewTypes.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CapacityReservationInstanceViewTypes. */ +public final class CapacityReservationInstanceViewTypes + extends ExpandableStringEnum { + /** Static value instanceView for CapacityReservationInstanceViewTypes. */ + public static final CapacityReservationInstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates or finds a CapacityReservationInstanceViewTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityReservationInstanceViewTypes. + */ + @JsonCreator + public static CapacityReservationInstanceViewTypes fromString(String name) { + return fromString(name, CapacityReservationInstanceViewTypes.class); + } + + /** @return known CapacityReservationInstanceViewTypes values. */ + public static Collection values() { + return values(CapacityReservationInstanceViewTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.java new file mode 100644 index 0000000000000..836c5f402a113 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationInstanceViewWithName.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the + * response to the instance view of a capacity reservation group. + */ +@Fluent +public final class CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationInstanceViewWithName.class); + + /* + * The name of the capacity reservation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the name property: The name of the capacity reservation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInstanceViewWithName withUtilizationInfo(CapacityReservationUtilization utilizationInfo) { + super.withUtilizationInfo(utilizationInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationInstanceViewWithName withStatuses(List statuses) { + super.withStatuses(statuses); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java new file mode 100644 index 0000000000000..b1b4b2a49e06b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list capacity reservation operation response. */ +@Fluent +public final class CapacityReservationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationListResult.class); + + /* + * The list of capacity reservations + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of capacity reservations. Call ListNext() + * with this URI to fetch the next page of capacity reservations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of capacity reservations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of capacity reservations. + * + * @param value the value value to set. + * @return the CapacityReservationListResult object itself. + */ + public CapacityReservationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of capacity reservations. Call ListNext() with this URI + * to fetch the next page of capacity reservations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of capacity reservations. Call ListNext() with this URI + * to fetch the next page of capacity reservations. + * + * @param nextLink the nextLink value to set. + * @return the CapacityReservationListResult object itself. + */ + public CapacityReservationListResult 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 CapacityReservationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.java new file mode 100644 index 0000000000000..32768883d30a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters of a capacity reservation Profile. */ +@Fluent +public final class CapacityReservationProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationProfile.class); + + /* + * Specifies the capacity reservation group resource id that should be used + * for allocating the virtual machine or scaleset vm instances provided + * enough capacity has been reserved. Please refer to + * https://aka.ms/CapacityReservation for more details. + */ + @JsonProperty(value = "capacityReservationGroup") + private SubResource capacityReservationGroup; + + /** + * Get the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @return the capacityReservationGroup value. + */ + public SubResource capacityReservationGroup() { + return this.capacityReservationGroup; + } + + /** + * Set the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param capacityReservationGroup the capacityReservationGroup value to set. + * @return the CapacityReservationProfile object itself. + */ + public CapacityReservationProfile withCapacityReservationGroup(SubResource capacityReservationGroup) { + this.capacityReservationGroup = capacityReservationGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java new file mode 100644 index 0000000000000..08054e6f34bc5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUpdate.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the capacity reservation. Only tags and sku.capacity can be updated. */ +@JsonFlatten +@Fluent +public class CapacityReservationUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationUpdate.class); + + /* + * SKU of the resource for which capacity needs be reserved. The SKU name + * and capacity is required to be set. Currently VM Skus with the + * capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for + * supported values. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * A unique id generated and assigned to the capacity reservation by the + * platform which does not change throughout the lifetime of the resource. + */ + @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * A list of all virtual machine resource ids that are associated with the + * capacity reservation. + */ + @JsonProperty(value = "properties.virtualMachinesAssociated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociated; + + /* + * The date time when the capacity reservation was last updated. + */ + @JsonProperty(value = "properties.provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Capacity reservation instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private CapacityReservationInstanceView instanceView; + + /** + * Get the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is + * required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are + * supported. Refer to List Microsoft.Compute SKUs in a region + * (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + * + * @param sku the sku value to set. + * @return the CapacityReservationUpdate object itself. + */ + public CapacityReservationUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform + * which does not change throughout the lifetime of the resource. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with + * the capacity reservation. + * + * @return the virtualMachinesAssociated value. + */ + public List virtualMachinesAssociated() { + return this.virtualMachinesAssociated; + } + + /** + * Get the provisioningTime property: The date time when the capacity reservation was last updated. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.provisioningTime; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The Capacity reservation instance view. + * + * @return the instanceView value. + */ + public CapacityReservationInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public CapacityReservationUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (virtualMachinesAssociated() != null) { + virtualMachinesAssociated().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java new file mode 100644 index 0000000000000..d7a35633226b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservationUtilization.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the capacity reservation utilization in terms of resources allocated. */ +@Immutable +public final class CapacityReservationUtilization { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityReservationUtilization.class); + + /* + * A list of all virtual machines resource ids allocated against the + * capacity reservation. + */ + @JsonProperty(value = "virtualMachinesAllocated", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAllocated; + + /** + * Get the virtualMachinesAllocated property: A list of all virtual machines resource ids allocated against the + * capacity reservation. + * + * @return the virtualMachinesAllocated value. + */ + public List virtualMachinesAllocated() { + return this.virtualMachinesAllocated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachinesAllocated() != null) { + virtualMachinesAllocated().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java new file mode 100644 index 0000000000000..a99ecf1cef582 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CapacityReservations.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 CapacityReservations. */ +public interface CapacityReservations { + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 capacityReservationGroupName, String capacityReservationName); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 capacityReservationGroupName, String capacityReservationName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + CapacityReservation get( + String resourceGroupName, String capacityReservationGroupName, String capacityReservationName); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param capacityReservationName The name of the capacity reservation. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + Response getWithResponse( + String resourceGroupName, + String capacityReservationGroupName, + String capacityReservationName, + CapacityReservationInstanceViewTypes expand, + Context context); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName); + + /** + * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in + * the response to get the next page of capacity reservations. + * + * @param resourceGroupName The name of the resource group. + * @param capacityReservationGroupName The name of the capacity reservation group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list capacity reservation operation response. + */ + PagedIterable listByCapacityReservationGroup( + String resourceGroupName, String capacityReservationGroupName, Context context); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + CapacityReservation getById(String id); + + /** + * The operation that retrieves information about the capacity reservation. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the capacity reservation that is managed by the platform and can change outside of control + * plane operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the capacity reservation. + */ + Response getByIdWithResponse( + String id, CapacityReservationInstanceViewTypes expand, Context context); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete a capacity reservation. This operation is allowed only when all the associated resources + * are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more + * details. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new CapacityReservation resource. + * + * @param name resource name. + * @return the first stage of the new CapacityReservation definition. + */ + CapacityReservation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java new file mode 100644 index 0000000000000..dfe42d7e9d8ef --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudService.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import java.util.Map; + +/** An immutable client-side representation of CloudService. */ +public interface CloudService { + /** + * 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 properties property: Cloud service properties. + * + * @return the properties value. + */ + CloudServiceProperties properties(); + + /** + * 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.compute.generated.fluent.models.CloudServiceInner object. + * + * @return the inner object. + */ + CloudServiceInner innerModel(); + + /** The entirety of the CloudService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CloudService definition stages. */ + interface DefinitionStages { + /** The first stage of the CloudService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CloudService 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 CloudService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CloudService 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudService create(Context context); + } + /** The stage of the CloudService 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 CloudService definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Cloud service properties. + * + * @param properties Cloud service properties. + * @return the next definition stage. + */ + WithCreate withProperties(CloudServiceProperties properties); + } + } + /** + * Begins update for the CloudService resource. + * + * @return the stage of resource update. + */ + CloudService.Update update(); + + /** The template for CloudService update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudService apply(Context context); + } + /** The CloudService update stages. */ + interface UpdateStages { + /** The stage of the CloudService 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. + */ + CloudService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudService refresh(Context context); + + /** + * Starts the cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts the cloud service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(RoleInstances parameters); + + /** + * Restarts one or more role instances in a cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(RoleInstances parameters); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(RoleInstances parameters); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(RoleInstances parameters); + + /** + * Deletes role instances in a cloud service. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(); + + /** + * Deletes role instances in a cloud service. + * + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(RoleInstances parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.java new file mode 100644 index 0000000000000..623145c3c1543 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a cloud service extension profile. */ +@Fluent +public final class CloudServiceExtensionProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceExtensionProfile.class); + + /* + * List of extensions for the cloud service. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** + * Get the extensions property: List of extensions for the cloud service. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: List of extensions for the cloud service. + * + * @param extensions the extensions value to set. + * @return the CloudServiceExtensionProfile object itself. + */ + public CloudServiceExtensionProfile withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java new file mode 100644 index 0000000000000..71bce6f8266c4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceExtensionProperties.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Extension Properties. */ +@Fluent +public final class CloudServiceExtensionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceExtensionProperties.class); + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the type of the extension. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the extension. Specifies the version of the + * extension. If this element is not specified or an asterisk (*) is used + * as the value, the latest version of the extension is used. If the value + * is specified with a major version number and an asterisk as the minor + * version number (X.), the latest minor version of the specified major + * version is selected. If a major version number and a minor version + * number are specified (X.Y), the specific extension version is selected. + * If a version is specified, an auto-upgrade is performed on the role + * instance. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Explicitly specify whether platform can automatically upgrade + * typeHandlerVersion to higher minor versions when they become available. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Public settings for the extension. For JSON extensions, this is the JSON + * settings for the extension. For XML Extension (like RDP), this is the + * XML setting for the extension. + */ + @JsonProperty(value = "settings") + private String settings; + + /* + * Protected settings for the extension which are encrypted before sent to + * the role instance. + */ + @JsonProperty(value = "protectedSettings") + private String protectedSettings; + + /* + * The protectedSettingsFromKeyVault property. + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault; + + /* + * Tag to force apply the provided public and protected settings. + * Changing the tag value allows for re-running the extension without + * changing any of the public or protected settings. + * If forceUpdateTag is not changed, updates to public or protected + * settings would still be applied by the handler. + * If neither forceUpdateTag nor any of public or protected settings + * change, extension would flow to the role instance with the same + * sequence-number, and + * it is up to handler implementation whether to re-run it or not + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Optional list of roles to apply this extension. If property is not + * specified or '*' is specified, extension is applied to all roles in the + * cloud service. + */ + @JsonProperty(value = "rolesAppliedTo") + private List rolesAppliedTo; + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension. + * + * @param type the type value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the extension. Specifies the version of the + * extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the + * extension is used. If the value is specified with a major version number and an asterisk as the minor version + * number (X.), the latest minor version of the specified major version is selected. If a major version number and a + * minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, + * an auto-upgrade is performed on the role instance. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the extension. Specifies the version of the + * extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the + * extension is used. If the value is specified with a major version number and an asterisk as the minor version + * number (X.), the latest minor version of the specified major version is selected. If a major version number and a + * minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, + * an auto-upgrade is performed on the role instance. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Explicitly specify whether platform can automatically upgrade + * typeHandlerVersion to higher minor versions when they become available. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Explicitly specify whether platform can automatically upgrade + * typeHandlerVersion to higher minor versions when they become available. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Public settings for the extension. For JSON extensions, this is the JSON settings for + * the extension. For XML Extension (like RDP), this is the XML setting for the extension. + * + * @return the settings value. + */ + public String settings() { + return this.settings; + } + + /** + * Set the settings property: Public settings for the extension. For JSON extensions, this is the JSON settings for + * the extension. For XML Extension (like RDP), this is the XML setting for the extension. + * + * @param settings the settings value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withSettings(String settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings for the extension which are encrypted before sent to the + * role instance. + * + * @return the protectedSettings value. + */ + public String protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings for the extension which are encrypted before sent to the + * role instance. + * + * @param protectedSettings the protectedSettings value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withProtectedSettings(String protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The protectedSettingsFromKeyVault property. + * + * @return the protectedSettingsFromKeyVault value. + */ + public CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The protectedSettingsFromKeyVault property. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withProtectedSettingsFromKeyVault( + CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Get the forceUpdateTag property: Tag to force apply the provided public and protected settings. Changing the tag + * value allows for re-running the extension without changing any of the public or protected settings. If + * forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If + * neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance + * with the same sequence-number, and it is up to handler implementation whether to re-run it or not. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: Tag to force apply the provided public and protected settings. Changing the tag + * value allows for re-running the extension without changing any of the public or protected settings. If + * forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. If + * neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance + * with the same sequence-number, and it is up to handler implementation whether to re-run it or not. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the rolesAppliedTo property: Optional list of roles to apply this extension. If property is not specified or + * '*' is specified, extension is applied to all roles in the cloud service. + * + * @return the rolesAppliedTo value. + */ + public List rolesAppliedTo() { + return this.rolesAppliedTo; + } + + /** + * Set the rolesAppliedTo property: Optional list of roles to apply this extension. If property is not specified or + * '*' is specified, extension is applied to all roles in the cloud service. + * + * @param rolesAppliedTo the rolesAppliedTo value to set. + * @return the CloudServiceExtensionProperties object itself. + */ + public CloudServiceExtensionProperties withRolesAppliedTo(List rolesAppliedTo) { + this.rolesAppliedTo = rolesAppliedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.java new file mode 100644 index 0000000000000..0eb16bb0a7b33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceInstanceView.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of CloudServiceInstanceView. */ +public interface CloudServiceInstanceView { + /** + * Gets the roleInstance property: Instance view statuses. + * + * @return the roleInstance value. + */ + InstanceViewStatusesSummary roleInstance(); + + /** + * Gets the sdkVersion property: The version of the SDK that was used to generate the package for the cloud service. + * + * @return the sdkVersion value. + */ + String sdkVersion(); + + /** + * Gets the privateIds property: Specifies a list of unique identifiers generated internally for the cloud service. + * <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as + * 'DeploymentId' for querying details. + * + * @return the privateIds value. + */ + List privateIds(); + + /** + * Gets the statuses property: The statuses property. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner object. + * + * @return the inner object. + */ + CloudServiceInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java new file mode 100644 index 0000000000000..e4718b4ea533e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CloudServiceListResult model. */ +@Fluent +public final class CloudServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the CloudServiceListResult object itself. + */ + public CloudServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the CloudServiceListResult object itself. + */ + public CloudServiceListResult 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 CloudServiceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java new file mode 100644 index 0000000000000..91c134d0febf6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceNetworkProfile.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Profile for the cloud service. */ +@Fluent +public final class CloudServiceNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceNetworkProfile.class); + + /* + * List of Load balancer configurations. Cloud service can have up to two + * load balancer configurations, corresponding to a Public Load Balancer + * and an Internal Load Balancer. + */ + @JsonProperty(value = "loadBalancerConfigurations") + private List loadBalancerConfigurations; + + /* + * The id reference of the cloud service containing the target IP with + * which the subject cloud service can perform a swap. This property cannot + * be updated once it is set. The swappable cloud service referred by this + * id must be present otherwise an error will be thrown. + */ + @JsonProperty(value = "swappableCloudService") + private SubResource swappableCloudService; + + /** + * Get the loadBalancerConfigurations property: List of Load balancer configurations. Cloud service can have up to + * two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. + * + * @return the loadBalancerConfigurations value. + */ + public List loadBalancerConfigurations() { + return this.loadBalancerConfigurations; + } + + /** + * Set the loadBalancerConfigurations property: List of Load balancer configurations. Cloud service can have up to + * two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. + * + * @param loadBalancerConfigurations the loadBalancerConfigurations value to set. + * @return the CloudServiceNetworkProfile object itself. + */ + public CloudServiceNetworkProfile withLoadBalancerConfigurations( + List loadBalancerConfigurations) { + this.loadBalancerConfigurations = loadBalancerConfigurations; + return this; + } + + /** + * Get the swappableCloudService property: The id reference of the cloud service containing the target IP with which + * the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud + * service referred by this id must be present otherwise an error will be thrown. + * + * @return the swappableCloudService value. + */ + public SubResource swappableCloudService() { + return this.swappableCloudService; + } + + /** + * Set the swappableCloudService property: The id reference of the cloud service containing the target IP with which + * the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud + * service referred by this id must be present otherwise an error will be thrown. + * + * @param swappableCloudService the swappableCloudService value to set. + * @return the CloudServiceNetworkProfile object itself. + */ + public CloudServiceNetworkProfile withSwappableCloudService(SubResource swappableCloudService) { + this.swappableCloudService = swappableCloudService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerConfigurations() != null) { + loadBalancerConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java new file mode 100644 index 0000000000000..62d89a13c1153 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOperatingSystems.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 CloudServiceOperatingSystems. */ +public interface CloudServiceOperatingSystems { + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + OSVersion getOSVersion(String location, String osVersionName); + + /** + * Gets properties of a guest operating system version that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS version pertains to. + * @param osVersionName Name of the OS version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system version that can be specified in the XML service configuration (. + */ + Response getOSVersionWithResponse(String location, String osVersionName, Context context); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + PagedIterable listOSVersions(String location); + + /** + * Gets a list of all guest operating system versions available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this + * till nextLink is null to fetch all the OS versions. + * + * @param location Name of the location that the OS versions pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system versions available to be specified in the XML service configuration + * (. + */ + PagedIterable listOSVersions(String location, Context context); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + OSFamily getOSFamily(String location, String osFamilyName); + + /** + * Gets properties of a guest operating system family that can be specified in the XML service configuration + * (.cscfg) for a cloud service. + * + * @param location Name of the location that the OS family pertains to. + * @param osFamilyName Name of the OS family. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a guest operating system family that can be specified in the XML service configuration (. + */ + Response getOSFamilyWithResponse(String location, String osFamilyName, Context context); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + PagedIterable listOSFamilies(String location); + + /** + * Gets a list of all guest operating system families available to be specified in the XML service configuration + * (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this + * till nextLink is null to fetch all the OS Families. + * + * @param location Name of the location that the OS families pertain to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all guest operating system families available to be specified in the XML service configuration + * (. + */ + PagedIterable listOSFamilies(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.java new file mode 100644 index 0000000000000..1293b5243f1fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceOsProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the OS profile for the cloud service. */ +@Fluent +public final class CloudServiceOsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceOsProfile.class); + + /* + * Specifies set of certificates that should be installed onto the role + * instances. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the role instances. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Specifies set of certificates that should be installed onto the role instances. + * + * @param secrets the secrets value to set. + * @return the CloudServiceOsProfile object itself. + */ + public CloudServiceOsProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java new file mode 100644 index 0000000000000..1a55331e8bf6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceProperties.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud service properties. */ +@Fluent +public final class CloudServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceProperties.class); + + /* + * Specifies a URL that refers to the location of the service package in + * the Blob service. The service package URL can be Shared Access Signature + * (SAS) URI from any storage account. + * This is a write-only property and is not returned in GET calls. + */ + @JsonProperty(value = "packageUrl") + private String packageUrl; + + /* + * Specifies the XML service configuration (.cscfg) for the cloud service. + */ + @JsonProperty(value = "configuration") + private String configuration; + + /* + * Specifies a URL that refers to the location of the service configuration + * in the Blob service. The service package URL can be Shared Access + * Signature (SAS) URI from any storage account. + * This is a write-only property and is not returned in GET calls. + */ + @JsonProperty(value = "configurationUrl") + private String configurationUrl; + + /* + * (Optional) Indicates whether to start the cloud service immediately + * after it is created. The default value is `true`. + * If false, the service model is still deployed, but the code is not run + * immediately. Instead, the service is PoweredOff until you call Start, at + * which time the service will be started. A deployed service still incurs + * charges, even if it is poweredoff. + */ + @JsonProperty(value = "startCloudService") + private Boolean startCloudService; + + /* + * (Optional) Indicates whether the role sku properties + * (roleProfile.roles.sku) specified in the model/template should override + * the role instance count and vm size specified in the .cscfg and .csdef + * respectively. + * The default value is `false`. + */ + @JsonProperty(value = "allowModelOverride") + private Boolean allowModelOverride; + + /* + * Update mode for the cloud service. Role instances are allocated to + * update domains when the service is deployed. Updates can be initiated + * manually in each update domain or initiated automatically in all update + * domains. + * Possible Values are

    **Auto**

    **Manual**

    **Simultaneous**

    + * If not specified, the default value is Auto. If set to Manual, PUT + * UpdateDomain must be called to apply the update. If set to Auto, the + * update is automatically applied to each update domain in sequence. + */ + @JsonProperty(value = "upgradeMode") + private CloudServiceUpgradeMode upgradeMode; + + /* + * Describes the role profile for the cloud service. + */ + @JsonProperty(value = "roleProfile") + private CloudServiceRoleProfile roleProfile; + + /* + * Describes the OS profile for the cloud service. + */ + @JsonProperty(value = "osProfile") + private CloudServiceOsProfile osProfile; + + /* + * Network Profile for the cloud service. + */ + @JsonProperty(value = "networkProfile") + private CloudServiceNetworkProfile networkProfile; + + /* + * Describes a cloud service extension profile. + */ + @JsonProperty(value = "extensionProfile") + private CloudServiceExtensionProfile extensionProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique identifier for the cloud service. + */ + @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /** + * Get the packageUrl property: Specifies a URL that refers to the location of the service package in the Blob + * service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a + * write-only property and is not returned in GET calls. + * + * @return the packageUrl value. + */ + public String packageUrl() { + return this.packageUrl; + } + + /** + * Set the packageUrl property: Specifies a URL that refers to the location of the service package in the Blob + * service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a + * write-only property and is not returned in GET calls. + * + * @param packageUrl the packageUrl value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withPackageUrl(String packageUrl) { + this.packageUrl = packageUrl; + return this; + } + + /** + * Get the configuration property: Specifies the XML service configuration (.cscfg) for the cloud service. + * + * @return the configuration value. + */ + public String configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Specifies the XML service configuration (.cscfg) for the cloud service. + * + * @param configuration the configuration value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withConfiguration(String configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the configurationUrl property: Specifies a URL that refers to the location of the service configuration in + * the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This + * is a write-only property and is not returned in GET calls. + * + * @return the configurationUrl value. + */ + public String configurationUrl() { + return this.configurationUrl; + } + + /** + * Set the configurationUrl property: Specifies a URL that refers to the location of the service configuration in + * the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This + * is a write-only property and is not returned in GET calls. + * + * @param configurationUrl the configurationUrl value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withConfigurationUrl(String configurationUrl) { + this.configurationUrl = configurationUrl; + return this; + } + + /** + * Get the startCloudService property: (Optional) Indicates whether to start the cloud service immediately after it + * is created. The default value is `true`. If false, the service model is still deployed, but the code is not run + * immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. + * A deployed service still incurs charges, even if it is poweredoff. + * + * @return the startCloudService value. + */ + public Boolean startCloudService() { + return this.startCloudService; + } + + /** + * Set the startCloudService property: (Optional) Indicates whether to start the cloud service immediately after it + * is created. The default value is `true`. If false, the service model is still deployed, but the code is not run + * immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. + * A deployed service still incurs charges, even if it is poweredoff. + * + * @param startCloudService the startCloudService value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withStartCloudService(Boolean startCloudService) { + this.startCloudService = startCloudService; + return this; + } + + /** + * Get the allowModelOverride property: (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) + * specified in the model/template should override the role instance count and vm size specified in the .cscfg and + * .csdef respectively. The default value is `false`. + * + * @return the allowModelOverride value. + */ + public Boolean allowModelOverride() { + return this.allowModelOverride; + } + + /** + * Set the allowModelOverride property: (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) + * specified in the model/template should override the role instance count and vm size specified in the .cscfg and + * .csdef respectively. The default value is `false`. + * + * @param allowModelOverride the allowModelOverride value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withAllowModelOverride(Boolean allowModelOverride) { + this.allowModelOverride = allowModelOverride; + return this; + } + + /** + * Get the upgradeMode property: Update mode for the cloud service. Role instances are allocated to update domains + * when the service is deployed. Updates can be initiated manually in each update domain or initiated automatically + * in all update domains. Possible Values are <br /><br />**Auto**<br /><br />**Manual** + * <br /><br />**Simultaneous**<br /><br /> If not specified, the default value is Auto. If + * set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically + * applied to each update domain in sequence. + * + * @return the upgradeMode value. + */ + public CloudServiceUpgradeMode upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode property: Update mode for the cloud service. Role instances are allocated to update domains + * when the service is deployed. Updates can be initiated manually in each update domain or initiated automatically + * in all update domains. Possible Values are <br /><br />**Auto**<br /><br />**Manual** + * <br /><br />**Simultaneous**<br /><br /> If not specified, the default value is Auto. If + * set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically + * applied to each update domain in sequence. + * + * @param upgradeMode the upgradeMode value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withUpgradeMode(CloudServiceUpgradeMode upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the roleProfile property: Describes the role profile for the cloud service. + * + * @return the roleProfile value. + */ + public CloudServiceRoleProfile roleProfile() { + return this.roleProfile; + } + + /** + * Set the roleProfile property: Describes the role profile for the cloud service. + * + * @param roleProfile the roleProfile value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withRoleProfile(CloudServiceRoleProfile roleProfile) { + this.roleProfile = roleProfile; + return this; + } + + /** + * Get the osProfile property: Describes the OS profile for the cloud service. + * + * @return the osProfile value. + */ + public CloudServiceOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Describes the OS profile for the cloud service. + * + * @param osProfile the osProfile value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withOsProfile(CloudServiceOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the networkProfile property: Network Profile for the cloud service. + * + * @return the networkProfile value. + */ + public CloudServiceNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network Profile for the cloud service. + * + * @param networkProfile the networkProfile value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withNetworkProfile(CloudServiceNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the extensionProfile property: Describes a cloud service extension profile. + * + * @return the extensionProfile value. + */ + public CloudServiceExtensionProfile extensionProfile() { + return this.extensionProfile; + } + + /** + * Set the extensionProfile property: Describes a cloud service extension profile. + * + * @param extensionProfile the extensionProfile value to set. + * @return the CloudServiceProperties object itself. + */ + public CloudServiceProperties withExtensionProfile(CloudServiceExtensionProfile extensionProfile) { + this.extensionProfile = extensionProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueId property: The unique identifier for the cloud service. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleProfile() != null) { + roleProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRole.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRole.java new file mode 100644 index 0000000000000..a3f2f8f745001 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRole.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; + +/** An immutable client-side representation of CloudServiceRole. */ +public interface CloudServiceRole { + /** + * Gets the id property: Resource id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the sku property: Describes the cloud service role sku. + * + * @return the sku value. + */ + CloudServiceRoleSku sku(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + CloudServiceRoleProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner object. + * + * @return the inner object. + */ + CloudServiceRoleInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleInstances.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleInstances.java new file mode 100644 index 0000000000000..aa706025e1120 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleInstances.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.StreamResponse; +import com.azure.core.util.Context; +import java.io.InputStream; + +/** Resource collection API of CloudServiceRoleInstances. */ +public interface CloudServiceRoleInstances { + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Deletes a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + RoleInstance get(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a role instance from a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role instance from a cloud service. + */ + Response getWithResponse( + String roleInstanceName, + String resourceGroupName, + String cloudServiceName, + InstanceViewTypes expand, + Context context); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + RoleInstanceView getInstanceView(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Retrieves information about the run-time state of a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of the role instance. + */ + Response getInstanceViewWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next + * page of role instances. Do this till nextLink is null to fetch all the role instances. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of all role instances in a cloud service. + */ + PagedIterable list( + String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or + * worker roles and initializes the storage resources that are used by them. If you do not want to initialize + * storage resources, you can use Reimage Role Instance. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + InputStream getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a remote desktop file for a role instance in a cloud service. + * + * @param roleInstanceName Name of the role instance. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a remote desktop file for a role instance in a cloud service. + */ + StreamResponse getRemoteDesktopFileWithResponse( + String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleListResult.java new file mode 100644 index 0000000000000..ce10319363450 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleListResult.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CloudServiceRoleListResult model. */ +@Fluent +public final class CloudServiceRoleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the CloudServiceRoleListResult object itself. + */ + public CloudServiceRoleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the CloudServiceRoleListResult object itself. + */ + public CloudServiceRoleListResult 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 CloudServiceRoleListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfile.java new file mode 100644 index 0000000000000..7355b72bad2a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the role profile for the cloud service. */ +@Fluent +public final class CloudServiceRoleProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleProfile.class); + + /* + * List of roles for the cloud service. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the roles property: List of roles for the cloud service. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: List of roles for the cloud service. + * + * @param roles the roles value to set. + * @return the CloudServiceRoleProfile object itself. + */ + public CloudServiceRoleProfile withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roles() != null) { + roles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfileProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfileProperties.java new file mode 100644 index 0000000000000..8cf362a58a23c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProfileProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the role properties. */ +@Fluent +public final class CloudServiceRoleProfileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleProfileProperties.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Describes the cloud service role sku. + */ + @JsonProperty(value = "sku") + private CloudServiceRoleSku sku; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the CloudServiceRoleProfileProperties object itself. + */ + public CloudServiceRoleProfileProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sku property: Describes the cloud service role sku. + * + * @return the sku value. + */ + public CloudServiceRoleSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the cloud service role sku. + * + * @param sku the sku value to set. + * @return the CloudServiceRoleProfileProperties object itself. + */ + public CloudServiceRoleProfileProperties withSku(CloudServiceRoleSku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProperties.java new file mode 100644 index 0000000000000..d67c702ba3d4a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudServiceRoleProperties model. */ +@Immutable +public final class CloudServiceRoleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleProperties.class); + + /* + * Specifies the ID which uniquely identifies a cloud service role. + */ + @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /** + * Get the uniqueId property: Specifies the ID which uniquely identifies a cloud service role. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleSku.java new file mode 100644 index 0000000000000..bf04f72f30bde --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoleSku.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the cloud service role sku. */ +@Fluent +public final class CloudServiceRoleSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceRoleSku.class); + + /* + * The sku name. NOTE: If the new SKU is not supported on the hardware the + * cloud service is currently on, you need to delete and recreate the cloud + * service or move back to the old sku. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the tier of the cloud service. Possible Values are

    **Standard**

    **Basic** + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Specifies the number of role instances in the cloud service. + */ + @JsonProperty(value = "capacity") + private Long capacity; + + /** + * Get the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is + * currently on, you need to delete and recreate the cloud service or move back to the old sku. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is + * currently on, you need to delete and recreate the cloud service or move back to the old sku. + * + * @param name the name value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br /> + * **Standard** <br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br /> + * **Standard** <br /><br /> **Basic**. + * + * @param tier the tier value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Specifies the number of role instances in the cloud service. + * + * @return the capacity value. + */ + public Long capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Specifies the number of role instances in the cloud service. + * + * @param capacity the capacity value to set. + * @return the CloudServiceRoleSku object itself. + */ + public CloudServiceRoleSku withCapacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java new file mode 100644 index 0000000000000..5cc35f2d63be8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceRoles.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 CloudServiceRoles. */ +public interface CloudServiceRoles { + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + CloudServiceRole get(String roleName, String resourceGroupName, String cloudServiceName); + + /** + * Gets a role from a cloud service. + * + * @param roleName Name of the role. + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a role from a cloud service. + */ + Response getWithResponse( + String roleName, String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + PagedIterable list(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. + * Do this till nextLink is null to fetch all the roles. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param cloudServiceName The cloudServiceName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all roles in a cloud service. + */ + PagedIterable list(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java new file mode 100644 index 0000000000000..d172f221702d0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpdate.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The CloudServiceUpdate model. */ +@Fluent +public final class CloudServiceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 CloudServiceUpdate object itself. + */ + public CloudServiceUpdate 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java new file mode 100644 index 0000000000000..ff81b9b432d31 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceUpgradeMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CloudServiceUpgradeMode. */ +public final class CloudServiceUpgradeMode extends ExpandableStringEnum { + /** Static value Auto for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode AUTO = fromString("Auto"); + + /** Static value Manual for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode MANUAL = fromString("Manual"); + + /** Static value Simultaneous for CloudServiceUpgradeMode. */ + public static final CloudServiceUpgradeMode SIMULTANEOUS = fromString("Simultaneous"); + + /** + * Creates or finds a CloudServiceUpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServiceUpgradeMode. + */ + @JsonCreator + public static CloudServiceUpgradeMode fromString(String name) { + return fromString(name, CloudServiceUpgradeMode.class); + } + + /** @return known CloudServiceUpgradeMode values. */ + public static Collection values() { + return values(CloudServiceUpgradeMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java new file mode 100644 index 0000000000000..f6282c0b84a82 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultAndSecretReference.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudServiceVaultAndSecretReference model. */ +@Fluent +public final class CloudServiceVaultAndSecretReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceVaultAndSecretReference.class); + + /* + * The sourceVault property. + */ + @JsonProperty(value = "sourceVault") + private SubResource sourceVault; + + /* + * The secretUrl property. + */ + @JsonProperty(value = "secretUrl") + private String secretUrl; + + /** + * Get the sourceVault property: The sourceVault property. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The sourceVault property. + * + * @param sourceVault the sourceVault value to set. + * @return the CloudServiceVaultAndSecretReference object itself. + */ + public CloudServiceVaultAndSecretReference withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the secretUrl property: The secretUrl property. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: The secretUrl property. + * + * @param secretUrl the secretUrl value to set. + * @return the CloudServiceVaultAndSecretReference object itself. + */ + public CloudServiceVaultAndSecretReference withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java new file mode 100644 index 0000000000000..17f3ebb82af9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultCertificate.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a single certificate reference in a Key Vault, and where the certificate should reside on the role + * instance. + */ +@Fluent +public final class CloudServiceVaultCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceVaultCertificate.class); + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as + * a secret. + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. + * + * @param certificateUrl the certificateUrl value to set. + * @return the CloudServiceVaultCertificate object itself. + */ + public CloudServiceVaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java new file mode 100644 index 0000000000000..e7937a9931b0c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServiceVaultSecretGroup.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a set of certificates which are all in the same Key Vault. */ +@Fluent +public final class CloudServiceVaultSecretGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudServiceVaultSecretGroup.class); + + /* + * The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + */ + @JsonProperty(value = "sourceVault") + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain + * certificates. + */ + @JsonProperty(value = "vaultCertificates") + private List vaultCertificates; + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the CloudServiceVaultSecretGroup object itself. + */ + public CloudServiceVaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the CloudServiceVaultSecretGroup object itself. + */ + public CloudServiceVaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultCertificates() != null) { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java new file mode 100644 index 0000000000000..08879e3cd483f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServices.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 CloudServices. */ +public interface CloudServices { + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Deletes a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, Context context); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + CloudService getByResourceGroup(String resourceGroupName, String cloudServiceName); + + /** + * Display information about a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + CloudServiceInstanceView getInstanceView(String resourceGroupName, String cloudServiceName); + + /** + * Gets the status of a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a cloud service. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + PagedIterable list(); + + /** + * Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the + * Cloud Services. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services in the subscription, regardless of the associated resource group. + */ + PagedIterable list(Context context); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next + * page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. + * + * @param resourceGroupName 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all cloud services under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName); + + /** + * Starts the cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, Context context); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String cloudServiceName); + + /** + * Power off the cloud service. Note that resources are still attached and you are getting charged for the + * resources. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String cloudServiceName, Context context); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, RoleInstances parameters); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName); + + /** + * Restarts one or more role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloudServiceName, RoleInstances parameters, Context context); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String cloudServiceName); + + /** + * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String resourceGroupName, String cloudServiceName); + + /** + * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes + * the storage resources that are used by them. If you do not want to initialize storage resources, you can use + * Reimage Role Instances. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(String resourceGroupName, String cloudServiceName); + + /** + * Deletes role instances in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param parameters List of cloud service role instance names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context); + + /** + * Display information about a cloud service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + CloudService getById(String id); + + /** + * Display information about a cloud service. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the cloud service. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a cloud service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 cloud service. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new CloudService resource. + * + * @param name resource name. + * @return the first stage of the new CloudService definition. + */ + CloudService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java new file mode 100644 index 0000000000000..1729a6d260c7a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CloudServicesUpdateDomains.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.UpdateDomainInner; + +/** Resource collection API of CloudServicesUpdateDomains. */ +public interface CloudServicesUpdateDomains { + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void walkUpdateDomain( + String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Updates the role instances in the specified update domain. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param parameters The update domain object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void walkUpdateDomain( + String resourceGroupName, + String cloudServiceName, + int updateDomain, + UpdateDomainInner parameters, + Context context); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + UpdateDomain getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain); + + /** + * Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page + * of update domains. Do this till nextLink is null to fetch all the update domains. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified + * with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified update domain of a cloud service. + */ + Response getUpdateDomainWithResponse( + String resourceGroupName, String cloudServiceName, int updateDomain, Context context); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName); + + /** + * Gets a list of all update domains in a cloud service. + * + * @param resourceGroupName Name of the resource group. + * @param cloudServiceName Name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update domains in a cloud service. + */ + PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComponentNames.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComponentNames.java new file mode 100644 index 0000000000000..080ac2c90927c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComponentNames.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ComponentNames. */ +public enum ComponentNames { + /** Enum value Microsoft-Windows-Shell-Setup. */ + MICROSOFT_WINDOWS_SHELL_SETUP("Microsoft-Windows-Shell-Setup"); + + /** The actual serialized value for a ComponentNames instance. */ + private final String value; + + ComponentNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ComponentNames instance. + * + * @param value the serialized value to parse. + * @return the parsed ComponentNames object, or null if unable to parse. + */ + @JsonCreator + public static ComponentNames fromString(String value) { + ComponentNames[] items = ComponentNames.values(); + for (ComponentNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationListResult.java new file mode 100644 index 0000000000000..23f2168045df6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationListResult.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Compute Operation operation response. */ +@Immutable +public final class ComputeOperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeOperationListResult.class); + + /* + * The list of compute operations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: The list of compute operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationValue.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationValue.java new file mode 100644 index 0000000000000..3ce3b547c3208 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ComputeOperationValue.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner; + +/** An immutable client-side representation of ComputeOperationValue. */ +public interface ComputeOperationValue { + /** + * Gets the origin property: The origin of the compute operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: The name of the compute operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + String resource(); + + /** + * Gets the description property: The description of the operation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.ComputeOperationValueInner object. + * + * @return the inner object. + */ + ComputeOperationValueInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java new file mode 100644 index 0000000000000..67e06ae53a387 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ConsistencyModeTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConsistencyModeTypes. */ +public final class ConsistencyModeTypes extends ExpandableStringEnum { + /** Static value CrashConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes CRASH_CONSISTENT = fromString("CrashConsistent"); + + /** Static value FileSystemConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes FILE_SYSTEM_CONSISTENT = fromString("FileSystemConsistent"); + + /** Static value ApplicationConsistent for ConsistencyModeTypes. */ + public static final ConsistencyModeTypes APPLICATION_CONSISTENT = fromString("ApplicationConsistent"); + + /** + * Creates or finds a ConsistencyModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsistencyModeTypes. + */ + @JsonCreator + public static ConsistencyModeTypes fromString(String name) { + return fromString(name, ConsistencyModeTypes.class); + } + + /** @return known ConsistencyModeTypes values. */ + public static Collection values() { + return values(ConsistencyModeTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java new file mode 100644 index 0000000000000..06a7795573b34 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/CreationData.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data used when creating a disk. */ +@Fluent +public final class CreationData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreationData.class); + + /* + * This enumerates the possible sources of a disk's creation. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOption createOption; + + /* + * Required if createOption is Import. The Azure Resource Manager + * identifier of the storage account containing the blob to import as a + * disk. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * Disk source information. + */ + @JsonProperty(value = "imageReference") + private ImageDiskReference imageReference; + + /* + * Required if creating from a Gallery Image. The id of the + * ImageDiskReference will be the ARM id of the shared galley image version + * from which to create a disk. + */ + @JsonProperty(value = "galleryImageReference") + private ImageDiskReference galleryImageReference; + + /* + * If createOption is Import, this is the URI of a blob to be imported into + * a managed disk. + */ + @JsonProperty(value = "sourceUri") + private String sourceUri; + + /* + * If createOption is Copy, this is the ARM id of the source snapshot or + * disk. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * If this field is set, this is the unique id identifying the source of + * this resource. + */ + @JsonProperty(value = "sourceUniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceUniqueId; + + /* + * If createOption is Upload, this is the size of the contents of the + * upload including the VHD footer. This value should be between 20972032 + * (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + * + 512 bytes for the VHD footer). + */ + @JsonProperty(value = "uploadSizeBytes") + private Long uploadSizeBytes; + + /* + * Logical sector size in bytes for Ultra disks. Supported values are 512 + * ad 4096. 4096 is the default. + */ + @JsonProperty(value = "logicalSectorSize") + private Integer logicalSectorSize; + + /** + * Get the createOption property: This enumerates the possible sources of a disk's creation. + * + * @return the createOption value. + */ + public DiskCreateOption createOption() { + return this.createOption; + } + + /** + * Set the createOption property: This enumerates the possible sources of a disk's creation. + * + * @param createOption the createOption value to set. + * @return the CreationData object itself. + */ + public CreationData withCreateOption(DiskCreateOption createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of + * the storage account containing the blob to import as a disk. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of + * the storage account containing the blob to import as a disk. + * + * @param storageAccountId the storageAccountId value to set. + * @return the CreationData object itself. + */ + public CreationData withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the imageReference property: Disk source information. + * + * @return the imageReference value. + */ + public ImageDiskReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Disk source information. + * + * @param imageReference the imageReference value to set. + * @return the CreationData object itself. + */ + public CreationData withImageReference(ImageDiskReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the galleryImageReference property: Required if creating from a Gallery Image. The id of the + * ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. + * + * @return the galleryImageReference value. + */ + public ImageDiskReference galleryImageReference() { + return this.galleryImageReference; + } + + /** + * Set the galleryImageReference property: Required if creating from a Gallery Image. The id of the + * ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. + * + * @param galleryImageReference the galleryImageReference value to set. + * @return the CreationData object itself. + */ + public CreationData withGalleryImageReference(ImageDiskReference galleryImageReference) { + this.galleryImageReference = galleryImageReference; + return this; + } + + /** + * Get the sourceUri property: If createOption is Import, this is the URI of a blob to be imported into a managed + * disk. + * + * @return the sourceUri value. + */ + public String sourceUri() { + return this.sourceUri; + } + + /** + * Set the sourceUri property: If createOption is Import, this is the URI of a blob to be imported into a managed + * disk. + * + * @param sourceUri the sourceUri value to set. + * @return the CreationData object itself. + */ + public CreationData withSourceUri(String sourceUri) { + this.sourceUri = sourceUri; + return this; + } + + /** + * Get the sourceResourceId property: If createOption is Copy, this is the ARM id of the source snapshot or disk. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: If createOption is Copy, this is the ARM id of the source snapshot or disk. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the CreationData object itself. + */ + public CreationData withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the sourceUniqueId property: If this field is set, this is the unique id identifying the source of this + * resource. + * + * @return the sourceUniqueId value. + */ + public String sourceUniqueId() { + return this.sourceUniqueId; + } + + /** + * Get the uploadSizeBytes property: If createOption is Upload, this is the size of the contents of the upload + * including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and + * 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + * + * @return the uploadSizeBytes value. + */ + public Long uploadSizeBytes() { + return this.uploadSizeBytes; + } + + /** + * Set the uploadSizeBytes property: If createOption is Upload, this is the size of the contents of the upload + * including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and + * 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + * + * @param uploadSizeBytes the uploadSizeBytes value to set. + * @return the CreationData object itself. + */ + public CreationData withUploadSizeBytes(Long uploadSizeBytes) { + this.uploadSizeBytes = uploadSizeBytes; + return this; + } + + /** + * Get the logicalSectorSize property: Logical sector size in bytes for Ultra disks. Supported values are 512 ad + * 4096. 4096 is the default. + * + * @return the logicalSectorSize value. + */ + public Integer logicalSectorSize() { + return this.logicalSectorSize; + } + + /** + * Set the logicalSectorSize property: Logical sector size in bytes for Ultra disks. Supported values are 512 ad + * 4096. 4096 is the default. + * + * @param logicalSectorSize the logicalSectorSize value to set. + * @return the CreationData object itself. + */ + public CreationData withLogicalSectorSize(Integer logicalSectorSize) { + this.logicalSectorSize = logicalSectorSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property createOption in model CreationData")); + } + if (imageReference() != null) { + imageReference().validate(); + } + if (galleryImageReference() != null) { + galleryImageReference().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java new file mode 100644 index 0000000000000..d93b785f00e44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class DataDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDisk.class); + + /* + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The virtual hard disk. + */ + @JsonProperty(value = "vhd") + private VirtualHardDisk vhd; + + /* + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + */ + @JsonProperty(value = "image") + private VirtualHardDisk image; + + /* + * Specifies the caching requirements.

    Possible values are: + *

    **None**

    **ReadOnly**

    **ReadWrite**

    + * Default: **None for Standard storage. ReadOnly for Premium storage** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * Specifies how the virtual machine should be created.

    Possible + * values are:

    **Attach** \u2013 This value is used when you are + * using a specialized disk to create the virtual machine.

    + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also + * use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can + * be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Specifies whether the data disk is in process of detachment from the + * VirtualMachine/VirtualMachineScaleset + */ + @JsonProperty(value = "toBeDetached") + private Boolean toBeDetached; + + /* + * Specifies the Read-Write IOPS for the managed disk when + * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine + * ScaleSet VM disks. Can be updated only via updates to the VirtualMachine + * Scale Set. + */ + @JsonProperty(value = "diskIOPSReadWrite", access = JsonProperty.Access.WRITE_ONLY) + private Long diskIopsReadWrite; + + /* + * Specifies the bandwidth in MB per second for the managed disk when + * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine + * ScaleSet VM disks. Can be updated only via updates to the VirtualMachine + * Scale Set. + */ + @JsonProperty(value = "diskMBpsReadWrite", access = JsonProperty.Access.WRITE_ONLY) + private Long diskMBpsReadWrite; + + /* + * Specifies the detach behavior to be used while detaching a disk or which + * is already in the process of detachment from the virtual machine. + * Supported values: **ForceDetach**.

    detachOption: + * **ForceDetach** is applicable only for managed data disks. If a previous + * detachment attempt of the data disk did not complete due to an + * unexpected failure from the virtual machine and the disk is still not + * released then use force-detach as a last resort option to detach the + * disk forcibly from the VM. All writes might not have been flushed when + * using this detach behavior.

    This feature is still in preview + * mode and is not supported for VirtualMachineScaleSet. To force-detach a + * data disk update toBeDetached to 'true' along with setting detachOption: + * 'ForceDetach'. + */ + @JsonProperty(value = "detachOption") + private DiskDetachOptionTypes detachOption; + + /* + * Specifies whether data disk should be deleted or detached upon VM + * deletion.

    Possible values:

    **Delete** If this value is + * used, the data disk is deleted when VM is deleted.

    **Detach** If + * this value is used, the data disk is retained after VM is + * deleted.

    The default value is set to **detach** + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** + * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @param lun the lun value to set. + * @return the DataDisk object itself. + */ + public DataDisk withLun(int lun) { + this.lun = lun; + return this; + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the DataDisk object itself. + */ + public DataDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the vhd property: The virtual hard disk. + * + * @return the vhd value. + */ + public VirtualHardDisk vhd() { + return this.vhd; + } + + /** + * Set the vhd property: The virtual hard disk. + * + * @param vhd the vhd value to set. + * @return the DataDisk object itself. + */ + public DataDisk withVhd(VirtualHardDisk vhd) { + this.vhd = vhd; + return this; + } + + /** + * Get the image property: The source user image virtual hard disk. The virtual hard disk will be copied before + * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * + * @return the image value. + */ + public VirtualHardDisk image() { + return this.image; + } + + /** + * Set the image property: The source user image virtual hard disk. The virtual hard disk will be copied before + * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * + * @param image the image value to set. + * @return the DataDisk object itself. + */ + public DataDisk withImage(VirtualHardDisk image) { + this.image = image; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @param caching the caching value to set. + * @return the DataDisk object itself. + */ + public DataDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the DataDisk object itself. + */ + public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the createOption property: Specifies how the virtual machine should be created.<br><br> Possible + * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to + * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an + * image to create the virtual machine. If you are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the plan element previously described. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machine should be created.<br><br> Possible + * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to + * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an + * image to create the virtual machine. If you are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the plan element previously described. + * + * @param createOption the createOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the DataDisk object itself. + */ + public DataDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the + * VirtualMachine/VirtualMachineScaleset. + * + * @return the toBeDetached value. + */ + public Boolean toBeDetached() { + return this.toBeDetached; + } + + /** + * Set the toBeDetached property: Specifies whether the data disk is in process of detachment from the + * VirtualMachine/VirtualMachineScaleset. + * + * @param toBeDetached the toBeDetached value to set. + * @return the DataDisk object itself. + */ + public DataDisk withToBeDetached(Boolean toBeDetached) { + this.toBeDetached = toBeDetached; + return this; + } + + /** + * Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is + * UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the + * VirtualMachine Scale Set. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when + * StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via + * updates to the VirtualMachine Scale Set. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Get the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is + * already in the process of detachment from the virtual machine. Supported values: **ForceDetach**. + * <br><br> detachOption: **ForceDetach** is applicable only for managed data disks. If a previous + * detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and + * the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the + * VM. All writes might not have been flushed when using this detach behavior. <br><br> This feature is + * still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update + * toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + * + * @return the detachOption value. + */ + public DiskDetachOptionTypes detachOption() { + return this.detachOption; + } + + /** + * Set the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is + * already in the process of detachment from the virtual machine. Supported values: **ForceDetach**. + * <br><br> detachOption: **ForceDetach** is applicable only for managed data disks. If a previous + * detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and + * the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the + * VM. All writes might not have been flushed when using this detach behavior. <br><br> This feature is + * still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update + * toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + * + * @param detachOption the detachOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDetachOption(DiskDetachOptionTypes detachOption) { + this.detachOption = detachOption; + return this; + } + + /** + * Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM + * deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data + * disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is + * retained after VM is deleted.<br><br> The default value is set to **detach**. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM + * deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data + * disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is + * retained after VM is deleted.<br><br> The default value is set to **detach**. + * + * @param deleteOption the deleteOption value to set. + * @return the DataDisk object itself. + */ + public DataDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vhd() != null) { + vhd().validate(); + } + if (image() != null) { + image().validate(); + } + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property createOption in model DataDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImage.java new file mode 100644 index 0000000000000..cb0fd07ce29b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImage.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the data disk images information. */ +@Immutable +public final class DataDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDiskImage.class); + + /* + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /** + * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImageEncryption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImageEncryption.java new file mode 100644 index 0000000000000..8eadc3a5a6996 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDiskImageEncryption.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains encryption settings for a data disk image. */ +@Fluent +public final class DataDiskImageEncryption extends DiskImageEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDiskImageEncryption.class); + + /* + * This property specifies the logical unit number of the data disk. This + * value is used to identify data disks within the Virtual Machine and + * therefore must be unique for each data disk attached to the Virtual + * Machine. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /** + * Get the lun property: This property specifies the logical unit number of the data disk. This value is used to + * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the + * Virtual Machine. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: This property specifies the logical unit number of the data disk. This value is used to + * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the + * Virtual Machine. + * + * @param lun the lun value to set. + * @return the DataDiskImageEncryption object itself. + */ + public DataDiskImageEncryption withLun(int lun) { + this.lun = lun; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataDiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { + super.withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHost.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHost.java new file mode 100644 index 0000000000000..8e6c5f71ae47a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHost.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DedicatedHost. */ +public interface DedicatedHost { + /** + * 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 sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is required to + * be set. List Microsoft.Compute SKUs for a list of possible values. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + * + * @return the autoReplaceOnFailure value. + */ + Boolean autoReplaceOnFailure(); + + /** + * Gets the hostId property: A unique id generated and assigned to the dedicated host by the platform. + * <br><br> Does not change throughout the lifetime of the host. + * + * @return the hostId value. + */ + String hostId(); + + /** + * Gets the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. + * + * @return the virtualMachines value. + */ + List virtualMachines(); + + /** + * Gets the licenseType property: Specifies the software license type that will be applied to the VMs deployed on + * the dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> + * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: + * **None**. + * + * @return the licenseType value. + */ + DedicatedHostLicenseTypes licenseType(); + + /** + * Gets the provisioningTime property: The date when the host was first provisioned. + * + * @return the provisioningTime value. + */ + OffsetDateTime provisioningTime(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The dedicated host instance view. + * + * @return the instanceView value. + */ + DedicatedHostInstanceView instanceView(); + + /** + * 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.compute.generated.fluent.models.DedicatedHostInner object. + * + * @return the inner object. + */ + DedicatedHostInner innerModel(); + + /** The entirety of the DedicatedHost definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The DedicatedHost definition stages. */ + interface DefinitionStages { + /** The first stage of the DedicatedHost definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DedicatedHost definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the DedicatedHost definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, hostGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @return the next definition stage. + */ + WithSku withExistingHostGroup(String resourceGroupName, String hostGroupName); + } + /** The stage of the DedicatedHost definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU of the dedicated host for Hardware Generation and VM family. Only name is + * required to be set. List Microsoft.Compute SKUs for a list of possible values.. + * + * @param sku SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be + * set. List Microsoft.Compute SKUs for a list of possible values. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the DedicatedHost 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.WithPlatformFaultDomain, + DefinitionStages.WithAutoReplaceOnFailure, + DefinitionStages.WithLicenseType { + /** + * Executes the create request. + * + * @return the created resource. + */ + DedicatedHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DedicatedHost create(Context context); + } + /** The stage of the DedicatedHost 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 DedicatedHost definition allowing to specify platformFaultDomain. */ + interface WithPlatformFaultDomain { + /** + * Specifies the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host + * group.. + * + * @param platformFaultDomain Fault domain of the dedicated host within a dedicated host group. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the DedicatedHost definition allowing to specify autoReplaceOnFailure. */ + interface WithAutoReplaceOnFailure { + /** + * Specifies the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced + * automatically in case of a failure. The value is defaulted to 'true' when not provided.. + * + * @param autoReplaceOnFailure Specifies whether the dedicated host should be replaced automatically in case + * of a failure. The value is defaulted to 'true' when not provided. + * @return the next definition stage. + */ + WithCreate withAutoReplaceOnFailure(Boolean autoReplaceOnFailure); + } + /** The stage of the DedicatedHost definition allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: Specifies the software license type that will be applied to the VMs + * deployed on the dedicated host. <br><br> Possible values are: <br><br> **None** + * <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** + * <br><br> Default: **None**. + * + * @param licenseType Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** + * <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** + * <br><br> Default: **None**. + * @return the next definition stage. + */ + WithCreate withLicenseType(DedicatedHostLicenseTypes licenseType); + } + } + /** + * Begins update for the DedicatedHost resource. + * + * @return the stage of resource update. + */ + DedicatedHost.Update update(); + + /** The template for DedicatedHost update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPlatformFaultDomain, + UpdateStages.WithAutoReplaceOnFailure, + UpdateStages.WithLicenseType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DedicatedHost apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DedicatedHost apply(Context context); + } + /** The DedicatedHost update stages. */ + interface UpdateStages { + /** The stage of the DedicatedHost 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); + } + /** The stage of the DedicatedHost update allowing to specify platformFaultDomain. */ + interface WithPlatformFaultDomain { + /** + * Specifies the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host + * group.. + * + * @param platformFaultDomain Fault domain of the dedicated host within a dedicated host group. + * @return the next definition stage. + */ + Update withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the DedicatedHost update allowing to specify autoReplaceOnFailure. */ + interface WithAutoReplaceOnFailure { + /** + * Specifies the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced + * automatically in case of a failure. The value is defaulted to 'true' when not provided.. + * + * @param autoReplaceOnFailure Specifies whether the dedicated host should be replaced automatically in case + * of a failure. The value is defaulted to 'true' when not provided. + * @return the next definition stage. + */ + Update withAutoReplaceOnFailure(Boolean autoReplaceOnFailure); + } + /** The stage of the DedicatedHost update allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: Specifies the software license type that will be applied to the VMs + * deployed on the dedicated host. <br><br> Possible values are: <br><br> **None** + * <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** + * <br><br> Default: **None**. + * + * @param licenseType Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** + * <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** + * <br><br> Default: **None**. + * @return the next definition stage. + */ + Update withLicenseType(DedicatedHostLicenseTypes licenseType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DedicatedHost refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DedicatedHost refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAllocatableVM.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAllocatableVM.java new file mode 100644 index 0000000000000..869ee774976b2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAllocatableVM.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the dedicated host unutilized capacity in terms of a specific VM size. */ +@Fluent +public final class DedicatedHostAllocatableVM { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostAllocatableVM.class); + + /* + * VM size in terms of which the unutilized capacity is represented. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * Maximum number of VMs of size vmSize that can fit in the dedicated + * host's remaining capacity. + */ + @JsonProperty(value = "count") + private Double count; + + /** + * Get the vmSize property: VM size in terms of which the unutilized capacity is represented. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: VM size in terms of which the unutilized capacity is represented. + * + * @param vmSize the vmSize value to set. + * @return the DedicatedHostAllocatableVM object itself. + */ + public DedicatedHostAllocatableVM withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the count property: Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining + * capacity. + * + * @return the count value. + */ + public Double count() { + return this.count; + } + + /** + * Set the count property: Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining + * capacity. + * + * @param count the count value to set. + * @return the DedicatedHostAllocatableVM object itself. + */ + public DedicatedHostAllocatableVM withCount(Double count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAvailableCapacity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAvailableCapacity.java new file mode 100644 index 0000000000000..15d11b7141e25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostAvailableCapacity.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dedicated host unutilized capacity. */ +@Fluent +public final class DedicatedHostAvailableCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostAvailableCapacity.class); + + /* + * The unutilized capacity of the dedicated host represented in terms of + * each VM size that is allowed to be deployed to the dedicated host. + */ + @JsonProperty(value = "allocatableVMs") + private List allocatableVMs; + + /** + * Get the allocatableVMs property: The unutilized capacity of the dedicated host represented in terms of each VM + * size that is allowed to be deployed to the dedicated host. + * + * @return the allocatableVMs value. + */ + public List allocatableVMs() { + return this.allocatableVMs; + } + + /** + * Set the allocatableVMs property: The unutilized capacity of the dedicated host represented in terms of each VM + * size that is allowed to be deployed to the dedicated host. + * + * @param allocatableVMs the allocatableVMs value to set. + * @return the DedicatedHostAvailableCapacity object itself. + */ + public DedicatedHostAvailableCapacity withAllocatableVMs(List allocatableVMs) { + this.allocatableVMs = allocatableVMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allocatableVMs() != null) { + allocatableVMs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroup.java new file mode 100644 index 0000000000000..e30a5115720b9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroup.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DedicatedHostGroup. */ +public interface DedicatedHostGroup { + /** + * 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 zones property: Availability Zone to use for this host group. Only single zone is supported. The zone + * can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @return the platformFaultDomainCount value. + */ + Integer platformFaultDomainCount(); + + /** + * Gets the hosts property: A list of references to all dedicated hosts in the dedicated host group. + * + * @return the hosts value. + */ + List hosts(); + + /** + * Gets the instanceView property: The dedicated host group instance view, which has the list of instance view of + * the dedicated hosts under the dedicated host group. + * + * @return the instanceView value. + */ + DedicatedHostGroupInstanceView instanceView(); + + /** + * Gets the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can + * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on + * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when + * not provided. <br><br>Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + Boolean supportAutomaticPlacement(); + + /** + * 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.compute.generated.fluent.models.DedicatedHostGroupInner object. + * + * @return the inner object. + */ + DedicatedHostGroupInner innerModel(); + + /** The entirety of the DedicatedHostGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DedicatedHostGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the DedicatedHostGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DedicatedHostGroup 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 DedicatedHostGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DedicatedHostGroup 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.WithZones, + DefinitionStages.WithPlatformFaultDomainCount, + DefinitionStages.WithSupportAutomaticPlacement { + /** + * Executes the create request. + * + * @return the created resource. + */ + DedicatedHostGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DedicatedHostGroup create(Context context); + } + /** The stage of the DedicatedHostGroup 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 DedicatedHostGroup definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zone to use for this host group. Only single zone is + * supported. The zone can be assigned only during creation. If not provided, the group supports all zones + * in the region. If provided, enforces each host in the group to be in the same zone.. + * + * @param zones Availability Zone to use for this host group. Only single zone is supported. The zone can be + * assigned only during creation. If not provided, the group supports all zones in the region. If + * provided, enforces each host in the group to be in the same zone. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the DedicatedHostGroup definition allowing to specify platformFaultDomainCount. */ + interface WithPlatformFaultDomainCount { + /** + * Specifies the platformFaultDomainCount property: Number of fault domains that the host group can span.. + * + * @param platformFaultDomainCount Number of fault domains that the host group can span. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomainCount(Integer platformFaultDomainCount); + } + /** The stage of the DedicatedHostGroup definition allowing to specify supportAutomaticPlacement. */ + interface WithSupportAutomaticPlacement { + /** + * Specifies the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine + * scale sets can be placed automatically on the dedicated host group. Automatic placement means resources + * are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is + * defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.. + * + * @param supportAutomaticPlacement Specifies whether virtual machines or virtual machine scale sets can be + * placed automatically on the dedicated host group. Automatic placement means resources are allocated + * on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted + * to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + WithCreate withSupportAutomaticPlacement(Boolean supportAutomaticPlacement); + } + } + /** + * Begins update for the DedicatedHostGroup resource. + * + * @return the stage of resource update. + */ + DedicatedHostGroup.Update update(); + + /** The template for DedicatedHostGroup update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithZones, + UpdateStages.WithPlatformFaultDomainCount, + UpdateStages.WithSupportAutomaticPlacement { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DedicatedHostGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DedicatedHostGroup apply(Context context); + } + /** The DedicatedHostGroup update stages. */ + interface UpdateStages { + /** The stage of the DedicatedHostGroup 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); + } + /** The stage of the DedicatedHostGroup update allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: Availability Zone to use for this host group. Only single zone is + * supported. The zone can be assigned only during creation. If not provided, the group supports all zones + * in the region. If provided, enforces each host in the group to be in the same zone.. + * + * @param zones Availability Zone to use for this host group. Only single zone is supported. The zone can be + * assigned only during creation. If not provided, the group supports all zones in the region. If + * provided, enforces each host in the group to be in the same zone. + * @return the next definition stage. + */ + Update withZones(List zones); + } + /** The stage of the DedicatedHostGroup update allowing to specify platformFaultDomainCount. */ + interface WithPlatformFaultDomainCount { + /** + * Specifies the platformFaultDomainCount property: Number of fault domains that the host group can span.. + * + * @param platformFaultDomainCount Number of fault domains that the host group can span. + * @return the next definition stage. + */ + Update withPlatformFaultDomainCount(Integer platformFaultDomainCount); + } + /** The stage of the DedicatedHostGroup update allowing to specify supportAutomaticPlacement. */ + interface WithSupportAutomaticPlacement { + /** + * Specifies the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine + * scale sets can be placed automatically on the dedicated host group. Automatic placement means resources + * are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is + * defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01.. + * + * @param supportAutomaticPlacement Specifies whether virtual machines or virtual machine scale sets can be + * placed automatically on the dedicated host group. Automatic placement means resources are allocated + * on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted + * to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + Update withSupportAutomaticPlacement(Boolean supportAutomaticPlacement); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DedicatedHostGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DedicatedHostGroup refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupInstanceView.java new file mode 100644 index 0000000000000..5407415534983 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupInstanceView.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DedicatedHostGroupInstanceView model. */ +@Fluent +public final class DedicatedHostGroupInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupInstanceView.class); + + /* + * List of instance view of the dedicated hosts under the dedicated host + * group. + */ + @JsonProperty(value = "hosts") + private List hosts; + + /** + * Get the hosts property: List of instance view of the dedicated hosts under the dedicated host group. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Set the hosts property: List of instance view of the dedicated hosts under the dedicated host group. + * + * @param hosts the hosts value to set. + * @return the DedicatedHostGroupInstanceView object itself. + */ + public DedicatedHostGroupInstanceView withHosts(List hosts) { + this.hosts = hosts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hosts() != null) { + hosts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupListResult.java new file mode 100644 index 0000000000000..dcb4c2f73fa4a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Dedicated Host Group with resource group response. */ +@Fluent +public final class DedicatedHostGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupListResult.class); + + /* + * The list of dedicated host groups + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of Dedicated Host Groups. Call ListNext() + * with this URI to fetch the next page of Dedicated Host Groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of dedicated host groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of dedicated host groups. + * + * @param value the value value to set. + * @return the DedicatedHostGroupListResult object itself. + */ + public DedicatedHostGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI + * to fetch the next page of Dedicated Host Groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI + * to fetch the next page of Dedicated Host Groups. + * + * @param nextLink the nextLink value to set. + * @return the DedicatedHostGroupListResult object itself. + */ + public DedicatedHostGroupListResult 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 DedicatedHostGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupUpdate.java new file mode 100644 index 0000000000000..afb1118a10827 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroupUpdate.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be + * updated. + */ +@JsonFlatten +@Fluent +public class DedicatedHostGroupUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostGroupUpdate.class); + + /* + * Availability Zone to use for this host group. Only single zone is + * supported. The zone can be assigned only during creation. If not + * provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Number of fault domains that the host group can span. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /* + * A list of references to all dedicated hosts in the dedicated host group. + */ + @JsonProperty(value = "properties.hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /* + * The dedicated host group instance view, which has the list of instance + * view of the dedicated hosts under the dedicated host group. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private DedicatedHostGroupInstanceView instanceView; + + /* + * Specifies whether virtual machines or virtual machine scale sets can be + * placed automatically on the dedicated host group. Automatic placement + * means resources are allocated on dedicated hosts, that are chosen by + * Azure, under the dedicated host group. The value is defaulted to 'false' + * when not provided.

    Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "properties.supportAutomaticPlacement") + private Boolean supportAutomaticPlacement; + + /** + * Get the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can + * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Availability Zone to use for this host group. Only single zone is supported. The zone can + * be assigned only during creation. If not provided, the group supports all zones in the region. If provided, + * enforces each host in the group to be in the same zone. + * + * @param zones the zones value to set. + * @return the DedicatedHostGroupUpdate object itself. + */ + public DedicatedHostGroupUpdate withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Number of fault domains that the host group can span. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the DedicatedHostGroupUpdate object itself. + */ + public DedicatedHostGroupUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get the hosts property: A list of references to all dedicated hosts in the dedicated host group. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Get the instanceView property: The dedicated host group instance view, which has the list of instance view of the + * dedicated hosts under the dedicated host group. + * + * @return the instanceView value. + */ + public DedicatedHostGroupInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can + * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on + * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when + * not provided. <br><br>Minimum api-version: 2020-06-01. + * + * @return the supportAutomaticPlacement value. + */ + public Boolean supportAutomaticPlacement() { + return this.supportAutomaticPlacement; + } + + /** + * Set the supportAutomaticPlacement property: Specifies whether virtual machines or virtual machine scale sets can + * be placed automatically on the dedicated host group. Automatic placement means resources are allocated on + * dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when + * not provided. <br><br>Minimum api-version: 2020-06-01. + * + * @param supportAutomaticPlacement the supportAutomaticPlacement value to set. + * @return the DedicatedHostGroupUpdate object itself. + */ + public DedicatedHostGroupUpdate withSupportAutomaticPlacement(Boolean supportAutomaticPlacement) { + this.supportAutomaticPlacement = supportAutomaticPlacement; + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostGroupUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (hosts() != null) { + hosts().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.java new file mode 100644 index 0000000000000..8f81daffaad39 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 DedicatedHostGroups. */ +public interface DedicatedHostGroups { + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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. + */ + void deleteByResourceGroup(String resourceGroupName, String hostGroupName); + + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the response. + */ + Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + DedicatedHostGroup getByResourceGroup(String resourceGroupName, String hostGroupName); + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context); + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @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 the List Dedicated Host Group with resource group response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + PagedIterable list(); + + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + PagedIterable list(Context context); + + /** + * Retrieves information about a dedicated host group. + * + * @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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + DedicatedHostGroup getById(String id); + + /** + * Retrieves information about a dedicated host group. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host + * 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 specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + Response getByIdWithResponse(String id, InstanceViewTypes expand, Context context); + + /** + * Delete a dedicated host group. + * + * @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); + + /** + * Delete a dedicated host group. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DedicatedHostGroup resource. + * + * @param name resource name. + * @return the first stage of the new DedicatedHostGroup definition. + */ + DedicatedHostGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceView.java new file mode 100644 index 0000000000000..866ceabe66593 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceView.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a dedicated host. */ +@Fluent +public class DedicatedHostInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInstanceView.class); + + /* + * Specifies the unique id of the dedicated physical machine on which the + * dedicated host resides. + */ + @JsonProperty(value = "assetId", access = JsonProperty.Access.WRITE_ONLY) + private String assetId; + + /* + * Unutilized capacity of the dedicated host. + */ + @JsonProperty(value = "availableCapacity") + private DedicatedHostAvailableCapacity availableCapacity; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the assetId property: Specifies the unique id of the dedicated physical machine on which the dedicated host + * resides. + * + * @return the assetId value. + */ + public String assetId() { + return this.assetId; + } + + /** + * Get the availableCapacity property: Unutilized capacity of the dedicated host. + * + * @return the availableCapacity value. + */ + public DedicatedHostAvailableCapacity availableCapacity() { + return this.availableCapacity; + } + + /** + * Set the availableCapacity property: Unutilized capacity of the dedicated host. + * + * @param availableCapacity the availableCapacity value to set. + * @return the DedicatedHostInstanceView object itself. + */ + public DedicatedHostInstanceView withAvailableCapacity(DedicatedHostAvailableCapacity availableCapacity) { + this.availableCapacity = availableCapacity; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the DedicatedHostInstanceView object itself. + */ + public DedicatedHostInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availableCapacity() != null) { + availableCapacity().validate(); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceViewWithName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceViewWithName.java new file mode 100644 index 0000000000000..9e487ad08c392 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostInstanceViewWithName.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to + * the instance view of a dedicated host group. + */ +@Fluent +public final class DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostInstanceViewWithName.class); + + /* + * The name of the dedicated host. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the name property: The name of the dedicated host. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInstanceViewWithName withAvailableCapacity(DedicatedHostAvailableCapacity availableCapacity) { + super.withAvailableCapacity(availableCapacity); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostInstanceViewWithName withStatuses(List statuses) { + super.withStatuses(statuses); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostLicenseTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostLicenseTypes.java new file mode 100644 index 0000000000000..ba5b2a9d2c974 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostLicenseTypes.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DedicatedHostLicenseTypes. */ +public enum DedicatedHostLicenseTypes { + /** Enum value None. */ + NONE("None"), + + /** Enum value Windows_Server_Hybrid. */ + WINDOWS_SERVER_HYBRID("Windows_Server_Hybrid"), + + /** Enum value Windows_Server_Perpetual. */ + WINDOWS_SERVER_PERPETUAL("Windows_Server_Perpetual"); + + /** The actual serialized value for a DedicatedHostLicenseTypes instance. */ + private final String value; + + DedicatedHostLicenseTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DedicatedHostLicenseTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed DedicatedHostLicenseTypes object, or null if unable to parse. + */ + @JsonCreator + public static DedicatedHostLicenseTypes fromString(String value) { + DedicatedHostLicenseTypes[] items = DedicatedHostLicenseTypes.values(); + for (DedicatedHostLicenseTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostListResult.java new file mode 100644 index 0000000000000..f20133d551d94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list dedicated host operation response. */ +@Fluent +public final class DedicatedHostListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostListResult.class); + + /* + * The list of dedicated hosts + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of dedicated hosts. Call ListNext() with + * this URI to fetch the next page of dedicated hosts. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of dedicated hosts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of dedicated hosts. + * + * @param value the value value to set. + * @return the DedicatedHostListResult object itself. + */ + public DedicatedHostListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to + * fetch the next page of dedicated hosts. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to + * fetch the next page of dedicated hosts. + * + * @param nextLink the nextLink value to set. + * @return the DedicatedHostListResult object itself. + */ + public DedicatedHostListResult 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 DedicatedHostListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.java new file mode 100644 index 0000000000000..94a6652872648 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostUpdate.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. */ +@JsonFlatten +@Fluent +public class DedicatedHostUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedHostUpdate.class); + + /* + * Fault domain of the dedicated host within a dedicated host group. + */ + @JsonProperty(value = "properties.platformFaultDomain") + private Integer platformFaultDomain; + + /* + * Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + */ + @JsonProperty(value = "properties.autoReplaceOnFailure") + private Boolean autoReplaceOnFailure; + + /* + * A unique id generated and assigned to the dedicated host by the + * platform.

    Does not change throughout the lifetime of the host. + */ + @JsonProperty(value = "properties.hostId", access = JsonProperty.Access.WRITE_ONLY) + private String hostId; + + /* + * A list of references to all virtual machines in the Dedicated Host. + */ + @JsonProperty(value = "properties.virtualMachines", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachines; + + /* + * Specifies the software license type that will be applied to the VMs + * deployed on the dedicated host.

    Possible values are:

    + * **None**

    **Windows_Server_Hybrid**

    + * **Windows_Server_Perpetual**

    Default: **None** + */ + @JsonProperty(value = "properties.licenseType") + private DedicatedHostLicenseTypes licenseType; + + /* + * The date when the host was first provisioned. + */ + @JsonProperty(value = "properties.provisioningTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime provisioningTime; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The dedicated host instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private DedicatedHostInstanceView instanceView; + + /** + * Get the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. + * + * @return the platformFaultDomain value. + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain property: Fault domain of the dedicated host within a dedicated host group. + * + * @param platformFaultDomain the platformFaultDomain value to set. + * @return the DedicatedHostUpdate object itself. + */ + public DedicatedHostUpdate withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + * + * @return the autoReplaceOnFailure value. + */ + public Boolean autoReplaceOnFailure() { + return this.autoReplaceOnFailure; + } + + /** + * Set the autoReplaceOnFailure property: Specifies whether the dedicated host should be replaced automatically in + * case of a failure. The value is defaulted to 'true' when not provided. + * + * @param autoReplaceOnFailure the autoReplaceOnFailure value to set. + * @return the DedicatedHostUpdate object itself. + */ + public DedicatedHostUpdate withAutoReplaceOnFailure(Boolean autoReplaceOnFailure) { + this.autoReplaceOnFailure = autoReplaceOnFailure; + return this; + } + + /** + * Get the hostId property: A unique id generated and assigned to the dedicated host by the platform. + * <br><br> Does not change throughout the lifetime of the host. + * + * @return the hostId value. + */ + public String hostId() { + return this.hostId; + } + + /** + * Get the virtualMachines property: A list of references to all virtual machines in the Dedicated Host. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Get the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> + * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: + * **None**. + * + * @return the licenseType value. + */ + public DedicatedHostLicenseTypes licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies the software license type that will be applied to the VMs deployed on the + * dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> + * **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: + * **None**. + * + * @param licenseType the licenseType value to set. + * @return the DedicatedHostUpdate object itself. + */ + public DedicatedHostUpdate withLicenseType(DedicatedHostLicenseTypes licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the provisioningTime property: The date when the host was first provisioned. + * + * @return the provisioningTime value. + */ + public OffsetDateTime provisioningTime() { + return this.provisioningTime; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The dedicated host instance view. + * + * @return the instanceView value. + */ + public DedicatedHostInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public DedicatedHostUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.java new file mode 100644 index 0000000000000..31683ea92e09e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.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.compute.generated.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 DedicatedHosts. */ +public interface DedicatedHosts { + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 hostGroupName, String hostname); + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 hostGroupName, String hostname, Context context); + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + DedicatedHost get(String resourceGroupName, String hostGroupName, String hostname); + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + Response getWithResponse( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context); + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName); + + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host 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 the list dedicated host operation response. + */ + PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context); + + /** + * Retrieves information about a dedicated host. + * + * @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 specifies information about the Dedicated host. + */ + DedicatedHost getById(String id); + + /** + * Retrieves information about a dedicated host. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance + * views of the dedicated host. 'UserData' is not supported for dedicated host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + Response getByIdWithResponse(String id, InstanceViewTypes expand, Context context); + + /** + * Delete a dedicated host. + * + * @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); + + /** + * Delete a dedicated host. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DedicatedHost resource. + * + * @param name resource name. + * @return the first stage of the new DedicatedHost definition. + */ + DedicatedHost.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java new file mode 100644 index 0000000000000..ef3601376fe0a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DeleteOptions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeleteOptions. */ +public final class DeleteOptions extends ExpandableStringEnum { + /** Static value Delete for DeleteOptions. */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** Static value Detach for DeleteOptions. */ + public static final DeleteOptions DETACH = fromString("Detach"); + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + @JsonCreator + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** @return known DeleteOptions values. */ + public static Collection values() { + return values(DeleteOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java new file mode 100644 index 0000000000000..626f4d2baaccf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiagnosticsProfile.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. */ +@Fluent +public final class DiagnosticsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsProfile.class); + + /* + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    You can easily + * view the output of your console log.

    Azure also enables you to + * see a screenshot of the VM from the hypervisor. + */ + @JsonProperty(value = "bootDiagnostics") + private BootDiagnostics bootDiagnostics; + + /** + * Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + public BootDiagnostics bootDiagnostics() { + return this.bootDiagnostics; + } + + /** + * Set the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. + * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @param bootDiagnostics the bootDiagnostics value to set. + * @return the DiagnosticsProfile object itself. + */ + public DiagnosticsProfile withBootDiagnostics(BootDiagnostics bootDiagnostics) { + this.bootDiagnostics = bootDiagnostics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bootDiagnostics() != null) { + bootDiagnostics().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.java new file mode 100644 index 0000000000000..47cbde396a03c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskOptions.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiffDiskOptions. */ +public final class DiffDiskOptions extends ExpandableStringEnum { + /** Static value Local for DiffDiskOptions. */ + public static final DiffDiskOptions LOCAL = fromString("Local"); + + /** + * Creates or finds a DiffDiskOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskOptions. + */ + @JsonCreator + public static DiffDiskOptions fromString(String name) { + return fromString(name, DiffDiskOptions.class); + } + + /** @return known DiffDiskOptions values. */ + public static Collection values() { + return values(DiffDiskOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.java new file mode 100644 index 0000000000000..f951a0de6d883 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskPlacement.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiffDiskPlacement. */ +public final class DiffDiskPlacement extends ExpandableStringEnum { + /** Static value CacheDisk for DiffDiskPlacement. */ + public static final DiffDiskPlacement CACHE_DISK = fromString("CacheDisk"); + + /** Static value ResourceDisk for DiffDiskPlacement. */ + public static final DiffDiskPlacement RESOURCE_DISK = fromString("ResourceDisk"); + + /** + * Creates or finds a DiffDiskPlacement from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskPlacement. + */ + @JsonCreator + public static DiffDiskPlacement fromString(String name) { + return fromString(name, DiffDiskPlacement.class); + } + + /** @return known DiffDiskPlacement values. */ + public static Collection values() { + return values(DiffDiskPlacement.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.java new file mode 100644 index 0000000000000..df8ef81f24e01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiffDiskSettings.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters of ephemeral disk settings that can be specified for operating system disk. + * <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. + */ +@Fluent +public final class DiffDiskSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiffDiskSettings.class); + + /* + * Specifies the ephemeral disk settings for operating system disk. + */ + @JsonProperty(value = "option") + private DiffDiskOptions option; + + /* + * Specifies the ephemeral disk placement for operating system + * disk.

    Possible values are:

    **CacheDisk**

    + * **ResourceDisk**

    Default: **CacheDisk** if one is configured + * for the VM size otherwise **ResourceDisk** is used.

    Refer to VM + * size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and + * Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check + * which VM sizes exposes a cache disk. + */ + @JsonProperty(value = "placement") + private DiffDiskPlacement placement; + + /** + * Get the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @return the option value. + */ + public DiffDiskOptions option() { + return this.option; + } + + /** + * Set the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @param option the option value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withOption(DiffDiskOptions option) { + this.option = option; + return this; + } + + /** + * Get the placement property: Specifies the ephemeral disk placement for operating system disk.<br><br> + * Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** + * <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is + * used.<br><br> Refer to VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @return the placement value. + */ + public DiffDiskPlacement placement() { + return this.placement; + } + + /** + * Set the placement property: Specifies the ephemeral disk placement for operating system disk.<br><br> + * Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** + * <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is + * used.<br><br> Refer to VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @param placement the placement value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java new file mode 100644 index 0000000000000..984e1880763b7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disallowed.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the disallowed disk types. */ +@Fluent +public final class Disallowed { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Disallowed.class); + + /* + * A list of disk types. + */ + @JsonProperty(value = "diskTypes") + private List diskTypes; + + /** + * Get the diskTypes property: A list of disk types. + * + * @return the diskTypes value. + */ + public List diskTypes() { + return this.diskTypes; + } + + /** + * Set the diskTypes property: A list of disk types. + * + * @param diskTypes the diskTypes value to set. + * @return the Disallowed object itself. + */ + public Disallowed withDiskTypes(List diskTypes) { + this.diskTypes = diskTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DisallowedConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DisallowedConfiguration.java new file mode 100644 index 0000000000000..02b3f5c1273ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DisallowedConfiguration.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the disallowed configuration for a virtual machine image. */ +@Fluent +public final class DisallowedConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DisallowedConfiguration.class); + + /* + * VM disk types which are disallowed. + */ + @JsonProperty(value = "vmDiskType") + private VmDiskTypes vmDiskType; + + /** + * Get the vmDiskType property: VM disk types which are disallowed. + * + * @return the vmDiskType value. + */ + public VmDiskTypes vmDiskType() { + return this.vmDiskType; + } + + /** + * Set the vmDiskType property: VM disk types which are disallowed. + * + * @param vmDiskType the vmDiskType value to set. + * @return the DisallowedConfiguration object itself. + */ + public DisallowedConfiguration withVmDiskType(VmDiskTypes vmDiskType) { + this.vmDiskType = vmDiskType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java new file mode 100644 index 0000000000000..71e737257634b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java @@ -0,0 +1,939 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Disk. */ +public interface Disk { + /** + * 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 managedBy property: A relative URI containing the ID of the VM that has the disk attached. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the managedByExtended property: List of relative URIs containing the IDs of the VMs that have the disk + * attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the managedByExtended value. + */ + List managedByExtended(); + + /** + * Gets the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * + * @return the sku value. + */ + DiskSku sku(); + + /** + * Gets the zones property: The Logical zone list for Disk. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the extendedLocation property: The extended location where the disk will be created. Extended location + * cannot be changed. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the timeCreated property: The time when the disk was created. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the osType property: The Operating System type. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}. + * + * @return the purchasePlan value. + */ + PurchasePlanAutoGenerated purchasePlan(); + + /** + * Gets the creationData property: Disk source information. CreationData information cannot be changed after the + * disk has been created. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + Integer diskSizeGB(); + + /** + * Gets the diskSizeBytes property: The size of the disk in bytes. This field is read only. + * + * @return the diskSizeBytes value. + */ + Long diskSizeBytes(); + + /** + * Gets the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk Encryption, + * can contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + EncryptionSettingsCollection encryptionSettingsCollection(); + + /** + * Gets the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. + * One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadWrite value. + */ + Long diskIopsReadWrite(); + + /** + * Gets the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * + * @return the diskMBpsReadWrite value. + */ + Long diskMBpsReadWrite(); + + /** + * Gets the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs mounting the + * shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadOnly value. + */ + Long diskIopsReadOnly(); + + /** + * Gets the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + * 10. + * + * @return the diskMBpsReadOnly value. + */ + Long diskMBpsReadOnly(); + + /** + * Gets the diskState property: The state of the disk. + * + * @return the diskState value. + */ + DiskState diskState(); + + /** + * Gets the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the maxShares property: The maximum number of VMs that can attach to the disk at the same time. Value + * greater than one indicates a disk that can be mounted on multiple VMs at the same time. + * + * @return the maxShares value. + */ + Integer maxShares(); + + /** + * Gets the shareInfo property: Details of the list of all VMs that have the disk attached. maxShares should be set + * to a value greater than one for disks to allow attaching them to multiple VMs. + * + * @return the shareInfo value. + */ + List shareInfo(); + + /** + * Gets the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + NetworkAccessPolicy networkAccessPolicy(); + + /** + * Gets the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + String diskAccessId(); + + /** + * Gets the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of + * the disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @return the burstingEnabled value. + */ + Boolean burstingEnabled(); + + /** + * Gets the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + PropertyUpdatesInProgress propertyUpdatesInProgress(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * Gets the securityProfile property: Contains the security related information for the resource. + * + * @return the securityProfile value. + */ + DiskSecurityProfile securityProfile(); + + /** + * 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.compute.generated.fluent.models.DiskInner object. + * + * @return the inner object. + */ + DiskInner innerModel(); + + /** The entirety of the Disk definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Disk definition stages. */ + interface DefinitionStages { + /** The first stage of the Disk definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Disk 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 Disk definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Disk 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.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithOsType, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithPurchasePlan, + DefinitionStages.WithCreationData, + DefinitionStages.WithDiskSizeGB, + DefinitionStages.WithEncryptionSettingsCollection, + DefinitionStages.WithDiskIopsReadWrite, + DefinitionStages.WithDiskMBpsReadWrite, + DefinitionStages.WithDiskIopsReadOnly, + DefinitionStages.WithDiskMBpsReadOnly, + DefinitionStages.WithEncryption, + DefinitionStages.WithMaxShares, + DefinitionStages.WithNetworkAccessPolicy, + DefinitionStages.WithDiskAccessId, + DefinitionStages.WithTier, + DefinitionStages.WithBurstingEnabled, + DefinitionStages.WithSupportsHibernation, + DefinitionStages.WithSecurityProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + Disk create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Disk create(Context context); + } + /** The stage of the Disk 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 Disk definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, or StandardSSD_ZRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * @return the next definition stage. + */ + WithCreate withSku(DiskSku sku); + } + /** The stage of the Disk definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The Logical zone list for Disk.. + * + * @param zones The Logical zone list for Disk. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the Disk definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location where the disk will be created. Extended + * location cannot be changed.. + * + * @param extendedLocation The extended location where the disk will be created. Extended location cannot be + * changed. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Disk definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The Operating System type.. + * + * @param osType The Operating System type. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + /** The stage of the Disk definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to + * OS disks only.. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + /** The stage of the Disk definition allowing to specify purchasePlan. */ + interface WithPurchasePlan { + /** + * Specifies the purchasePlan property: Purchase plan information for the the image from which the OS disk + * was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}. + * + * @param purchasePlan Purchase plan information for the the image from which the OS disk was created. E.g. + * - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}. + * @return the next definition stage. + */ + WithCreate withPurchasePlan(PurchasePlanAutoGenerated purchasePlan); + } + /** The stage of the Disk definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: Disk source information. CreationData information cannot be changed + * after the disk has been created.. + * + * @param creationData Disk source information. CreationData information cannot be changed after the disk + * has been created. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the Disk definition allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + WithCreate withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Disk definition allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used for Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used for Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Disk definition allowing to specify diskIopsReadWrite. */ + interface WithDiskIopsReadWrite { + /** + * Specifies the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for + * UltraSSD disks. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadWrite The number of IOPS allowed for this disk; only settable for UltraSSD disks. One + * operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + WithCreate withDiskIopsReadWrite(Long diskIopsReadWrite); + } + /** The stage of the Disk definition allowing to specify diskMBpsReadWrite. */ + interface WithDiskMBpsReadWrite { + /** + * Specifies the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD + * disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.. + * + * @param diskMBpsReadWrite The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * @return the next definition stage. + */ + WithCreate withDiskMBpsReadWrite(Long diskMBpsReadWrite); + } + /** The stage of the Disk definition allowing to specify diskIopsReadOnly. */ + interface WithDiskIopsReadOnly { + /** + * Specifies the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs + * mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadOnly The total number of IOPS that will be allowed across all VMs mounting the shared + * disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + WithCreate withDiskIopsReadOnly(Long diskIopsReadOnly); + } + /** The stage of the Disk definition allowing to specify diskMBpsReadOnly. */ + interface WithDiskMBpsReadOnly { + /** + * Specifies the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs + * mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO + * notation, of powers of 10.. + * + * @param diskMBpsReadOnly The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of + * powers of 10. + * @return the next definition stage. + */ + WithCreate withDiskMBpsReadOnly(Long diskMBpsReadOnly); + } + /** The stage of the Disk definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the Disk definition allowing to specify maxShares. */ + interface WithMaxShares { + /** + * Specifies the maxShares property: The maximum number of VMs that can attach to the disk at the same time. + * Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.. + * + * @param maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * @return the next definition stage. + */ + WithCreate withMaxShares(Integer maxShares); + } + /** The stage of the Disk definition allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + WithCreate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Disk definition allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + WithCreate withDiskAccessId(String diskAccessId); + } + /** The stage of the Disk definition allowing to specify tier. */ + interface WithTier { + /** + * Specifies the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.. + * + * @param tier Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * @return the next definition stage. + */ + WithCreate withTier(String tier); + } + /** The stage of the Disk definition allowing to specify burstingEnabled. */ + interface WithBurstingEnabled { + /** + * Specifies the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance + * target of the disk. Bursting is disabled by default. Does not apply to Ultra disks.. + * + * @param burstingEnabled Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * @return the next definition stage. + */ + WithCreate withBurstingEnabled(Boolean burstingEnabled); + } + /** The stage of the Disk definition allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a disk supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a disk supports hibernation. + * @return the next definition stage. + */ + WithCreate withSupportsHibernation(Boolean supportsHibernation); + } + /** The stage of the Disk definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Contains the security related information for the resource.. + * + * @param securityProfile Contains the security related information for the resource. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(DiskSecurityProfile securityProfile); + } + } + /** + * Begins update for the Disk resource. + * + * @return the stage of resource update. + */ + Disk.Update update(); + + /** The template for Disk update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithOsType, + UpdateStages.WithDiskSizeGB, + UpdateStages.WithEncryptionSettingsCollection, + UpdateStages.WithDiskIopsReadWrite, + UpdateStages.WithDiskMBpsReadWrite, + UpdateStages.WithDiskIopsReadOnly, + UpdateStages.WithDiskMBpsReadOnly, + UpdateStages.WithMaxShares, + UpdateStages.WithEncryption, + UpdateStages.WithNetworkAccessPolicy, + UpdateStages.WithDiskAccessId, + UpdateStages.WithTier, + UpdateStages.WithBurstingEnabled, + UpdateStages.WithPurchasePlan, + UpdateStages.WithSupportsHibernation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Disk apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Disk apply(Context context); + } + /** The Disk update stages. */ + interface UpdateStages { + /** The stage of the Disk 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); + } + /** The stage of the Disk update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, or StandardSSD_ZRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * @return the next definition stage. + */ + Update withSku(DiskSku sku); + } + /** The stage of the Disk update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: the Operating System type.. + * + * @param osType the Operating System type. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + /** The stage of the Disk update allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + Update withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Disk update allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + Update withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Disk update allowing to specify diskIopsReadWrite. */ + interface WithDiskIopsReadWrite { + /** + * Specifies the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for + * UltraSSD disks. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadWrite The number of IOPS allowed for this disk; only settable for UltraSSD disks. One + * operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + Update withDiskIopsReadWrite(Long diskIopsReadWrite); + } + /** The stage of the Disk update allowing to specify diskMBpsReadWrite. */ + interface WithDiskMBpsReadWrite { + /** + * Specifies the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD + * disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.. + * + * @param diskMBpsReadWrite The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * @return the next definition stage. + */ + Update withDiskMBpsReadWrite(Long diskMBpsReadWrite); + } + /** The stage of the Disk update allowing to specify diskIopsReadOnly. */ + interface WithDiskIopsReadOnly { + /** + * Specifies the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs + * mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes.. + * + * @param diskIopsReadOnly The total number of IOPS that will be allowed across all VMs mounting the shared + * disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * @return the next definition stage. + */ + Update withDiskIopsReadOnly(Long diskIopsReadOnly); + } + /** The stage of the Disk update allowing to specify diskMBpsReadOnly. */ + interface WithDiskMBpsReadOnly { + /** + * Specifies the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs + * mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO + * notation, of powers of 10.. + * + * @param diskMBpsReadOnly The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of + * powers of 10. + * @return the next definition stage. + */ + Update withDiskMBpsReadOnly(Long diskMBpsReadOnly); + } + /** The stage of the Disk update allowing to specify maxShares. */ + interface WithMaxShares { + /** + * Specifies the maxShares property: The maximum number of VMs that can attach to the disk at the same time. + * Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.. + * + * @param maxShares The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * @return the next definition stage. + */ + Update withMaxShares(Integer maxShares); + } + /** The stage of the Disk update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the Disk update allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + Update withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Disk update allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + Update withDiskAccessId(String diskAccessId); + } + /** The stage of the Disk update allowing to specify tier. */ + interface WithTier { + /** + * Specifies the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.. + * + * @param tier Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * @return the next definition stage. + */ + Update withTier(String tier); + } + /** The stage of the Disk update allowing to specify burstingEnabled. */ + interface WithBurstingEnabled { + /** + * Specifies the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance + * target of the disk. Bursting is disabled by default. Does not apply to Ultra disks.. + * + * @param burstingEnabled Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * @return the next definition stage. + */ + Update withBurstingEnabled(Boolean burstingEnabled); + } + /** The stage of the Disk update allowing to specify purchasePlan. */ + interface WithPurchasePlan { + /** + * Specifies the purchasePlan property: Purchase plan information to be added on the OS disk. + * + * @param purchasePlan Purchase plan information to be added on the OS disk. + * @return the next definition stage. + */ + Update withPurchasePlan(PurchasePlanAutoGenerated purchasePlan); + } + /** The stage of the Disk update allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a disk supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a disk supports hibernation. + * @return the next definition stage. + */ + Update withSupportsHibernation(Boolean supportsHibernation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Disk refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Disk refresh(Context context); + + /** + * Grants access to a disk. + * + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData); + + /** + * Grants access to a disk. + * + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a disk. + * + * @throws com.azure.core.management.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 revokeAccess(); + + /** + * Revokes access to a disk. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java new file mode 100644 index 0000000000000..dadb3e8e24dad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccess.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DiskAccess. */ +public interface DiskAccess { + /** + * 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 privateEndpointConnections property: A readonly collection of private endpoint connections created on + * the disk. Currently only one endpoint connection is supported. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the provisioningState property: The disk access resource provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the timeCreated property: The time when the disk access was created. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * 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.compute.generated.fluent.models.DiskAccessInner object. + * + * @return the inner object. + */ + DiskAccessInner innerModel(); + + /** The entirety of the DiskAccess definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DiskAccess definition stages. */ + interface DefinitionStages { + /** The first stage of the DiskAccess definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DiskAccess 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 DiskAccess definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DiskAccess 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + DiskAccess create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DiskAccess create(Context context); + } + /** The stage of the DiskAccess 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); + } + } + /** + * Begins update for the DiskAccess resource. + * + * @return the stage of resource update. + */ + DiskAccess.Update update(); + + /** The template for DiskAccess update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DiskAccess apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DiskAccess apply(Context context); + } + /** The DiskAccess update stages. */ + interface UpdateStages { + /** The stage of the DiskAccess 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. + */ + DiskAccess refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DiskAccess refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.java new file mode 100644 index 0000000000000..fea45a2dfd0ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List disk access operation response. */ +@Fluent +public final class DiskAccessList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskAccessList.class); + + /* + * A list of disk access resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of disk access resources. Call ListNext() + * with this to fetch the next page of disk access resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of disk access resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of disk access resources. + * + * @param value the value value to set. + * @return the DiskAccessList object itself. + */ + public DiskAccessList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of disk access resources. Call ListNext() with this to + * fetch the next page of disk access resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of disk access resources. Call ListNext() with this to + * fetch the next page of disk access resources. + * + * @param nextLink the nextLink value to set. + * @return the DiskAccessList object itself. + */ + public DiskAccessList 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 DiskAccessList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.java new file mode 100644 index 0000000000000..774bde8e8cc35 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccessUpdate.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Used for updating a disk access resource. */ +@Fluent +public final class DiskAccessUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskAccessUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 DiskAccessUpdate object itself. + */ + public DiskAccessUpdate 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccesses.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccesses.java new file mode 100644 index 0000000000000..586cc73e82eab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskAccesses.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of DiskAccesses. */ +public interface DiskAccesses { + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + DiskAccess getByResourceGroup(String resourceGroupName, String diskAccessName); + + /** + * Gets information about a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskAccessName, Context context); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String diskAccessName); + + /** + * Deletes a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskAccessName, Context context); + + /** + * Lists all the disk access resources under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disk access resources under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disk access resources under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + PagedIterable list(); + + /** + * Lists all the disk access resources under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk access operation response. + */ + PagedIterable list(Context context); + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + PrivateLinkResourceListResult getPrivateLinkResources(String resourceGroupName, String diskAccessName); + + /** + * Gets the private link resources possible under disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources possible under disk access resource. + */ + Response getPrivateLinkResourcesWithResponse( + String resourceGroupName, String diskAccessName, Context context); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + PrivateEndpointConnection updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new + * private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put private + * endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + PrivateEndpointConnection updateAPrivateEndpointConnection( + String resourceGroupName, + String diskAccessName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + PrivateEndpointConnection getAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName); + + /** + * Gets information about a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a private endpoint connection under a disk access resource. + */ + Response getAPrivateEndpointConnectionWithResponse( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAPrivateEndpointConnection( + String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context); + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName); + + /** + * List information about private endpoint connections under a disk access resource. + * + * @param resourceGroupName The name of the resource group. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be changed after + * the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + * name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String diskAccessName, Context context); + + /** + * Gets information about a disk access resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + DiskAccess getById(String id); + + /** + * Gets information about a disk access resource. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk access resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a disk access resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 disk access resource. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new DiskAccess resource. + * + * @param name resource name. + * @return the first stage of the new DiskAccess definition. + */ + DiskAccess.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.java new file mode 100644 index 0000000000000..8e069d5fb3f6f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOption.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.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskCreateOption. */ +public final class DiskCreateOption extends ExpandableStringEnum { + /** Static value Empty for DiskCreateOption. */ + public static final DiskCreateOption EMPTY = fromString("Empty"); + + /** Static value Attach for DiskCreateOption. */ + public static final DiskCreateOption ATTACH = fromString("Attach"); + + /** Static value FromImage for DiskCreateOption. */ + public static final DiskCreateOption FROM_IMAGE = fromString("FromImage"); + + /** Static value Import for DiskCreateOption. */ + public static final DiskCreateOption IMPORT = fromString("Import"); + + /** Static value Copy for DiskCreateOption. */ + public static final DiskCreateOption COPY = fromString("Copy"); + + /** Static value Restore for DiskCreateOption. */ + public static final DiskCreateOption RESTORE = fromString("Restore"); + + /** Static value Upload for DiskCreateOption. */ + public static final DiskCreateOption UPLOAD = fromString("Upload"); + + /** + * Creates or finds a DiskCreateOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskCreateOption. + */ + @JsonCreator + public static DiskCreateOption fromString(String name) { + return fromString(name, DiskCreateOption.class); + } + + /** @return known DiskCreateOption values. */ + public static Collection values() { + return values(DiskCreateOption.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.java new file mode 100644 index 0000000000000..e2e1d409004d5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskCreateOptionTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskCreateOptionTypes. */ +public final class DiskCreateOptionTypes extends ExpandableStringEnum { + /** Static value FromImage for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes FROM_IMAGE = fromString("FromImage"); + + /** Static value Empty for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); + + /** Static value Attach for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes ATTACH = fromString("Attach"); + + /** + * Creates or finds a DiskCreateOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskCreateOptionTypes. + */ + @JsonCreator + public static DiskCreateOptionTypes fromString(String name) { + return fromString(name, DiskCreateOptionTypes.class); + } + + /** @return known DiskCreateOptionTypes values. */ + public static Collection values() { + return values(DiskCreateOptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java new file mode 100644 index 0000000000000..5b4313fd26ea6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDeleteOptionTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskDeleteOptionTypes. */ +public final class DiskDeleteOptionTypes extends ExpandableStringEnum { + /** Static value Delete for DiskDeleteOptionTypes. */ + public static final DiskDeleteOptionTypes DELETE = fromString("Delete"); + + /** Static value Detach for DiskDeleteOptionTypes. */ + public static final DiskDeleteOptionTypes DETACH = fromString("Detach"); + + /** + * Creates or finds a DiskDeleteOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskDeleteOptionTypes. + */ + @JsonCreator + public static DiskDeleteOptionTypes fromString(String name) { + return fromString(name, DiskDeleteOptionTypes.class); + } + + /** @return known DiskDeleteOptionTypes values. */ + public static Collection values() { + return values(DiskDeleteOptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java new file mode 100644 index 0000000000000..1ab4482559cac --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskDetachOptionTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskDetachOptionTypes. */ +public final class DiskDetachOptionTypes extends ExpandableStringEnum { + /** Static value ForceDetach for DiskDetachOptionTypes. */ + public static final DiskDetachOptionTypes FORCE_DETACH = fromString("ForceDetach"); + + /** + * Creates or finds a DiskDetachOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskDetachOptionTypes. + */ + @JsonCreator + public static DiskDetachOptionTypes fromString(String name) { + return fromString(name, DiskDetachOptionTypes.class); + } + + /** @return known DiskDetachOptionTypes values. */ + public static Collection values() { + return values(DiskDetachOptionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java new file mode 100644 index 0000000000000..abd29fbe1a9a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DiskEncryptionSet. */ +public interface DiskEncryptionSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The managed identity for the disk encryption set. It should be given permission on + * the key vault before it can be used to encrypt disks. + * + * @return the identity value. + */ + EncryptionSetIdentity identity(); + + /** + * Gets the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @return the encryptionType value. + */ + DiskEncryptionSetType encryptionType(); + + /** + * Gets the activeKey property: The key vault key which is currently used by this disk encryption set. + * + * @return the activeKey value. + */ + KeyForDiskEncryptionSet activeKey(); + + /** + * Gets the previousKeys property: A readonly collection of key vault keys previously used by this disk encryption + * set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + * + * @return the previousKeys value. + */ + List previousKeys(); + + /** + * Gets the provisioningState property: The disk encryption set provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + Boolean rotationToLatestKeyVersionEnabled(); + + /** + * Gets the lastKeyRotationTimestamp property: The time when the active key of this disk encryption set was updated. + * + * @return the lastKeyRotationTimestamp value. + */ + OffsetDateTime lastKeyRotationTimestamp(); + + /** + * 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.compute.generated.fluent.models.DiskEncryptionSetInner object. + * + * @return the inner object. + */ + DiskEncryptionSetInner innerModel(); + + /** The entirety of the DiskEncryptionSet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DiskEncryptionSet definition stages. */ + interface DefinitionStages { + /** The first stage of the DiskEncryptionSet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DiskEncryptionSet 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 DiskEncryptionSet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DiskEncryptionSet 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.WithIdentity, + DefinitionStages.WithEncryptionType, + DefinitionStages.WithActiveKey, + DefinitionStages.WithRotationToLatestKeyVersionEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + DiskEncryptionSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DiskEncryptionSet create(Context context); + } + /** The stage of the DiskEncryptionSet 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 DiskEncryptionSet definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks.. + * + * @param identity The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * @return the next definition stage. + */ + WithCreate withIdentity(EncryptionSetIdentity identity); + } + /** The stage of the DiskEncryptionSet definition allowing to specify encryptionType. */ + interface WithEncryptionType { + /** + * Specifies the encryptionType property: The type of key used to encrypt the data of the disk.. + * + * @param encryptionType The type of key used to encrypt the data of the disk. + * @return the next definition stage. + */ + WithCreate withEncryptionType(DiskEncryptionSetType encryptionType); + } + /** The stage of the DiskEncryptionSet definition allowing to specify activeKey. */ + interface WithActiveKey { + /** + * Specifies the activeKey property: The key vault key which is currently used by this disk encryption set.. + * + * @param activeKey The key vault key which is currently used by this disk encryption set. + * @return the next definition stage. + */ + WithCreate withActiveKey(KeyForDiskEncryptionSet activeKey); + } + /** The stage of the DiskEncryptionSet definition allowing to specify rotationToLatestKeyVersionEnabled. */ + interface WithRotationToLatestKeyVersionEnabled { + /** + * Specifies the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating + * of this disk encryption set to the latest key version.. + * + * @param rotationToLatestKeyVersionEnabled Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * @return the next definition stage. + */ + WithCreate withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled); + } + } + /** + * Begins update for the DiskEncryptionSet resource. + * + * @return the stage of resource update. + */ + DiskEncryptionSet.Update update(); + + /** The template for DiskEncryptionSet update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithEncryptionType, + UpdateStages.WithActiveKey, + UpdateStages.WithRotationToLatestKeyVersionEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DiskEncryptionSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DiskEncryptionSet apply(Context context); + } + /** The DiskEncryptionSet update stages. */ + interface UpdateStages { + /** The stage of the DiskEncryptionSet 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); + } + /** The stage of the DiskEncryptionSet update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks.. + * + * @param identity The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * @return the next definition stage. + */ + Update withIdentity(EncryptionSetIdentity identity); + } + /** The stage of the DiskEncryptionSet update allowing to specify encryptionType. */ + interface WithEncryptionType { + /** + * Specifies the encryptionType property: The type of key used to encrypt the data of the disk.. + * + * @param encryptionType The type of key used to encrypt the data of the disk. + * @return the next definition stage. + */ + Update withEncryptionType(DiskEncryptionSetType encryptionType); + } + /** The stage of the DiskEncryptionSet update allowing to specify activeKey. */ + interface WithActiveKey { + /** + * Specifies the activeKey property: Key Vault Key Url to be used for server side encryption of Managed + * Disks and Snapshots. + * + * @param activeKey Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. + * @return the next definition stage. + */ + Update withActiveKey(KeyForDiskEncryptionSet activeKey); + } + /** The stage of the DiskEncryptionSet update allowing to specify rotationToLatestKeyVersionEnabled. */ + interface WithRotationToLatestKeyVersionEnabled { + /** + * Specifies the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating + * of this disk encryption set to the latest key version.. + * + * @param rotationToLatestKeyVersionEnabled Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * @return the next definition stage. + */ + Update withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DiskEncryptionSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DiskEncryptionSet refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.java new file mode 100644 index 0000000000000..de70e244629cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetIdentityType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskEncryptionSetIdentityType. */ +public final class DiskEncryptionSetIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value None for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType NONE = fromString("None"); + + /** + * Creates or finds a DiskEncryptionSetIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskEncryptionSetIdentityType. + */ + @JsonCreator + public static DiskEncryptionSetIdentityType fromString(String name) { + return fromString(name, DiskEncryptionSetIdentityType.class); + } + + /** @return known DiskEncryptionSetIdentityType values. */ + public static Collection values() { + return values(DiskEncryptionSetIdentityType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.java new file mode 100644 index 0000000000000..9f4c4b592bbe5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List disk encryption set operation response. */ +@Fluent +public final class DiskEncryptionSetList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetList.class); + + /* + * A list of disk encryption sets. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of disk encryption sets. Call ListNext() + * with this to fetch the next page of disk encryption sets. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of disk encryption sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of disk encryption sets. + * + * @param value the value value to set. + * @return the DiskEncryptionSetList object itself. + */ + public DiskEncryptionSetList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of disk encryption sets. Call ListNext() with this to + * fetch the next page of disk encryption sets. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of disk encryption sets. Call ListNext() with this to + * fetch the next page of disk encryption sets. + * + * @param nextLink the nextLink value to set. + * @return the DiskEncryptionSetList object itself. + */ + public DiskEncryptionSetList 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 DiskEncryptionSetList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java new file mode 100644 index 0000000000000..ce32d2df69a20 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetParameters.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** + * Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. + * <br><br> NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer + * https://aka.ms/mdssewithcmkoverview for more details. + */ +@Fluent +public final class DiskEncryptionSetParameters extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetParameters.class); + + /** {@inheritDoc} */ + @Override + public DiskEncryptionSetParameters withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.java new file mode 100644 index 0000000000000..584abc21c742f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskEncryptionSetType. */ +public final class DiskEncryptionSetType extends ExpandableStringEnum { + /** Static value EncryptionAtRestWithCustomerKey for DiskEncryptionSetType. */ + public static final DiskEncryptionSetType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = + fromString("EncryptionAtRestWithCustomerKey"); + + /** Static value EncryptionAtRestWithPlatformAndCustomerKeys for DiskEncryptionSetType. */ + public static final DiskEncryptionSetType ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = + fromString("EncryptionAtRestWithPlatformAndCustomerKeys"); + + /** + * Creates or finds a DiskEncryptionSetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskEncryptionSetType. + */ + @JsonCreator + public static DiskEncryptionSetType fromString(String name) { + return fromString(name, DiskEncryptionSetType.class); + } + + /** @return known DiskEncryptionSetType values. */ + public static Collection values() { + return values(DiskEncryptionSetType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.java new file mode 100644 index 0000000000000..ddd0ccc12ab88 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** disk encryption set update resource. */ +@JsonFlatten +@Fluent +public class DiskEncryptionSetUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The managed identity for the disk encryption set. It should be given + * permission on the key vault before it can be used to encrypt disks. + */ + @JsonProperty(value = "identity") + private EncryptionSetIdentity identity; + + /* + * The type of key used to encrypt the data of the disk. + */ + @JsonProperty(value = "properties.encryptionType") + private DiskEncryptionSetType encryptionType; + + /* + * Key Vault Key Url to be used for server side encryption of Managed Disks + * and Snapshots + */ + @JsonProperty(value = "properties.activeKey") + private KeyForDiskEncryptionSet activeKey; + + /* + * Set this flag to true to enable auto-updating of this disk encryption + * set to the latest key version. + */ + @JsonProperty(value = "properties.rotationToLatestKeyVersionEnabled") + private Boolean rotationToLatestKeyVersionEnabled; + + /** + * 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 DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @return the identity value. + */ + public EncryptionSetIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity for the disk encryption set. It should be given permission on the + * key vault before it can be used to encrypt disks. + * + * @param identity the identity value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withIdentity(EncryptionSetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @return the encryptionType value. + */ + public DiskEncryptionSetType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: The type of key used to encrypt the data of the disk. + * + * @param encryptionType the encryptionType value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withEncryptionType(DiskEncryptionSetType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the activeKey property: Key Vault Key Url to be used for server side encryption of Managed Disks and + * Snapshots. + * + * @return the activeKey value. + */ + public KeyForDiskEncryptionSet activeKey() { + return this.activeKey; + } + + /** + * Set the activeKey property: Key Vault Key Url to be used for server side encryption of Managed Disks and + * Snapshots. + * + * @param activeKey the activeKey value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withActiveKey(KeyForDiskEncryptionSet activeKey) { + this.activeKey = activeKey; + return this; + } + + /** + * Get the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @return the rotationToLatestKeyVersionEnabled value. + */ + public Boolean rotationToLatestKeyVersionEnabled() { + return this.rotationToLatestKeyVersionEnabled; + } + + /** + * Set the rotationToLatestKeyVersionEnabled property: Set this flag to true to enable auto-updating of this disk + * encryption set to the latest key version. + * + * @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set. + * @return the DiskEncryptionSetUpdate object itself. + */ + public DiskEncryptionSetUpdate withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) { + this.rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (activeKey() != null) { + activeKey().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.java new file mode 100644 index 0000000000000..1a8cdb7b92f1c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSets.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 DiskEncryptionSets. */ +public interface DiskEncryptionSets { + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + DiskEncryptionSet getByResourceGroup(String resourceGroupName, String diskEncryptionSetName); + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskEncryptionSetName, Context context); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String diskEncryptionSetName); + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 diskEncryptionSetName, Context context); + + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disk encryption sets under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disk encryption sets under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + PagedIterable list(); + + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + PagedIterable list(Context context); + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + PagedIterable listAssociatedResources(String resourceGroupName, String diskEncryptionSetName); + + /** + * Lists all resources that are encrypted with this disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List resources which are encrypted with the disk encryption set. + */ + PagedIterable listAssociatedResources( + String resourceGroupName, String diskEncryptionSetName, Context context); + + /** + * Gets information about a disk encryption set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + DiskEncryptionSet getById(String id); + + /** + * Gets information about a disk encryption set. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a disk encryption set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 disk encryption set. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new DiskEncryptionSet resource. + * + * @param name resource name. + * @return the first stage of the new DiskEncryptionSet definition. + */ + DiskEncryptionSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.java new file mode 100644 index 0000000000000..634e348cd9b83 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSettings.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a Encryption Settings for a Disk. */ +@Fluent +public final class DiskEncryptionSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSettings.class); + + /* + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + */ + @JsonProperty(value = "diskEncryptionKey") + private KeyVaultSecretReference diskEncryptionKey; + + /* + * Specifies the location of the key encryption key in Key Vault. + */ + @JsonProperty(value = "keyEncryptionKey") + private KeyVaultKeyReference keyEncryptionKey; + + /* + * Specifies whether disk encryption should be enabled on the virtual + * machine. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the diskEncryptionKey property: Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @return the diskEncryptionKey value. + */ + public KeyVaultSecretReference diskEncryptionKey() { + return this.diskEncryptionKey; + } + + /** + * Set the diskEncryptionKey property: Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param diskEncryptionKey the diskEncryptionKey value to set. + * @return the DiskEncryptionSettings object itself. + */ + public DiskEncryptionSettings withDiskEncryptionKey(KeyVaultSecretReference diskEncryptionKey) { + this.diskEncryptionKey = diskEncryptionKey; + return this; + } + + /** + * Get the keyEncryptionKey property: Specifies the location of the key encryption key in Key Vault. + * + * @return the keyEncryptionKey value. + */ + public KeyVaultKeyReference keyEncryptionKey() { + return this.keyEncryptionKey; + } + + /** + * Set the keyEncryptionKey property: Specifies the location of the key encryption key in Key Vault. + * + * @param keyEncryptionKey the keyEncryptionKey value to set. + * @return the DiskEncryptionSettings object itself. + */ + public DiskEncryptionSettings withKeyEncryptionKey(KeyVaultKeyReference keyEncryptionKey) { + this.keyEncryptionKey = keyEncryptionKey; + return this; + } + + /** + * Get the enabled property: Specifies whether disk encryption should be enabled on the virtual machine. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether disk encryption should be enabled on the virtual machine. + * + * @param enabled the enabled value to set. + * @return the DiskEncryptionSettings object itself. + */ + public DiskEncryptionSettings withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionKey() != null) { + diskEncryptionKey().validate(); + } + if (keyEncryptionKey() != null) { + keyEncryptionKey().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskImageEncryption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskImageEncryption.java new file mode 100644 index 0000000000000..7a081ac33ae1c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskImageEncryption.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image encryption base class. */ +@Fluent +public class DiskImageEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskImageEncryption.class); + + /* + * A relative URI containing the resource ID of the disk encryption set. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /** + * Get the diskEncryptionSetId property: A relative URI containing the resource ID of the disk encryption set. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: A relative URI containing the resource ID of the disk encryption set. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the DiskImageEncryption object itself. + */ + public DiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.java new file mode 100644 index 0000000000000..f0fffb3611eab --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskInstanceView.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the disk. */ +@Fluent +public final class DiskInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInstanceView.class); + + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + */ + @JsonProperty(value = "encryptionSettings") + private List encryptionSettings; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the DiskInstanceView object itself. + */ + public DiskInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the encryptionSettings value. + */ + public List encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> + * Minimum api-version: 2015-06-15. + * + * @param encryptionSettings the encryptionSettings value to set. + * @return the DiskInstanceView object itself. + */ + public DiskInstanceView withEncryptionSettings(List encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the DiskInstanceView object itself. + */ + public DiskInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().forEach(e -> e.validate()); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.java new file mode 100644 index 0000000000000..424c5b9212d13 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskList.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Disks operation response. */ +@Fluent +public final class DiskList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskList.class); + + /* + * A list of disks. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of disks. Call ListNext() with this to + * fetch the next page of disks. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of disks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of disks. + * + * @param value the value value to set. + * @return the DiskList object itself. + */ + public DiskList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of disks. Call ListNext() with this to fetch the next + * page of disks. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of disks. Call ListNext() with this to fetch the next + * page of disks. + * + * @param nextLink the nextLink value to set. + * @return the DiskList object itself. + */ + public DiskList 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 DiskList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.java new file mode 100644 index 0000000000000..767d3e263fb88 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of DiskRestorePoint. */ +public interface DiskRestorePoint { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the timeCreated property: The timestamp of restorePoint creation. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the sourceResourceId property: arm id of source disk. + * + * @return the sourceResourceId value. + */ + String sourceResourceId(); + + /** + * Gets the osType property: The Operating System type. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the purchasePlan property: Purchase plan information for the the image from which the OS disk was created. + * + * @return the purchasePlan value. + */ + PurchasePlanAutoGenerated purchasePlan(); + + /** + * Gets the familyId property: id of the backing snapshot's MIS family. + * + * @return the familyId value. + */ + String familyId(); + + /** + * Gets the sourceUniqueId property: unique incarnation id of the source disk. + * + * @return the sourceUniqueId value. + */ + String sourceUniqueId(); + + /** + * Gets the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner object. + * + * @return the inner object. + */ + DiskRestorePointInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointList.java new file mode 100644 index 0000000000000..6a2c3c939badd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePointList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Disk Restore Points operation response. */ +@Fluent +public final class DiskRestorePointList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskRestorePointList.class); + + /* + * A list of disk restore points. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of disk restore points. Call ListNext() + * with this to fetch the next page of disk restore points. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of disk restore points. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of disk restore points. + * + * @param value the value value to set. + * @return the DiskRestorePointList object itself. + */ + public DiskRestorePointList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of disk restore points. Call ListNext() with this to + * fetch the next page of disk restore points. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of disk restore points. Call ListNext() with this to + * fetch the next page of disk restore points. + * + * @param nextLink the nextLink value to set. + * @return the DiskRestorePointList object itself. + */ + public DiskRestorePointList 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 DiskRestorePointList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java new file mode 100644 index 0000000000000..e1efbb6ed144e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 DiskRestorePoints. */ +public interface DiskRestorePoints { + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + DiskRestorePoint get( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Get disk restorePoint resource. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk restorePoint resource. + */ + Response getWithResponse( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName); + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disk Restore Points operation response. + */ + PagedIterable listByRestorePoint( + String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData); + + /** + * Grants access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + GrantAccessData grantAccessData, + Context context); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName); + + /** + * Revokes access to a diskRestorePoint. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection that the disk restore point belongs. + * Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param diskRestorePointName The name of the disk restore point created. Supported characters for the name are + * a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeAccess( + String resourceGroupName, + String restorePointCollectionName, + String vmRestorePointName, + String diskRestorePointName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.java new file mode 100644 index 0000000000000..2b91613ea1891 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the security related information for the resource. */ +@Fluent +public final class DiskSecurityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskSecurityProfile.class); + + /* + * Specifies the SecurityType of the VM. Applicable for OS disks only. + */ + @JsonProperty(value = "securityType") + private DiskSecurityTypes securityType; + + /** + * Get the securityType property: Specifies the SecurityType of the VM. Applicable for OS disks only. + * + * @return the securityType value. + */ + public DiskSecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the VM. Applicable for OS disks only. + * + * @param securityType the securityType value to set. + * @return the DiskSecurityProfile object itself. + */ + public DiskSecurityProfile withSecurityType(DiskSecurityTypes securityType) { + this.securityType = securityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java new file mode 100644 index 0000000000000..38a3146df4968 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSecurityTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskSecurityTypes. */ +public final class DiskSecurityTypes extends ExpandableStringEnum { + /** Static value TrustedLaunch for DiskSecurityTypes. */ + public static final DiskSecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * Creates or finds a DiskSecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskSecurityTypes. + */ + @JsonCreator + public static DiskSecurityTypes fromString(String name) { + return fromString(name, DiskSecurityTypes.class); + } + + /** @return known DiskSecurityTypes values. */ + public static Collection values() { + return values(DiskSecurityTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java new file mode 100644 index 0000000000000..28816762ba05c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, or StandardSSD_ZRS. + */ +@Fluent +public final class DiskSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskSku.class); + + /* + * The sku name. + */ + @JsonProperty(value = "name") + private DiskStorageAccountTypes name; + + /* + * The sku tier. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public DiskStorageAccountTypes name() { + return this.name; + } + + /** + * Set the name property: The sku name. + * + * @param name the name value to set. + * @return the DiskSku object itself. + */ + public DiskSku withName(DiskStorageAccountTypes name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.java new file mode 100644 index 0000000000000..d5372e8f7a15b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskState. */ +public final class DiskState extends ExpandableStringEnum { + /** Static value Unattached for DiskState. */ + public static final DiskState UNATTACHED = fromString("Unattached"); + + /** Static value Attached for DiskState. */ + public static final DiskState ATTACHED = fromString("Attached"); + + /** Static value Reserved for DiskState. */ + public static final DiskState RESERVED = fromString("Reserved"); + + /** Static value ActiveSAS for DiskState. */ + public static final DiskState ACTIVE_SAS = fromString("ActiveSAS"); + + /** Static value ReadyToUpload for DiskState. */ + public static final DiskState READY_TO_UPLOAD = fromString("ReadyToUpload"); + + /** Static value ActiveUpload for DiskState. */ + public static final DiskState ACTIVE_UPLOAD = fromString("ActiveUpload"); + + /** + * Creates or finds a DiskState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskState. + */ + @JsonCreator + public static DiskState fromString(String name) { + return fromString(name, DiskState.class); + } + + /** @return known DiskState values. */ + public static Collection values() { + return values(DiskState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.java new file mode 100644 index 0000000000000..29e31b76d55f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiskStorageAccountTypes. */ +public final class DiskStorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** Static value UltraSSD_LRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** Static value Premium_ZRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value StandardSSD_ZRS for DiskStorageAccountTypes. */ + public static final DiskStorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** + * Creates or finds a DiskStorageAccountTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskStorageAccountTypes. + */ + @JsonCreator + public static DiskStorageAccountTypes fromString(String name) { + return fromString(name, DiskStorageAccountTypes.class); + } + + /** @return known DiskStorageAccountTypes values. */ + public static Collection values() { + return values(DiskStorageAccountTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java new file mode 100644 index 0000000000000..633f905a53038 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Disk update resource. */ +@JsonFlatten +@Fluent +public class DiskUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, + * UltraSSD_LRS, Premium_ZRS, or StandardSSD_ZRS. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /* + * the Operating System type. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /* + * Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * The number of IOPS allowed for this disk; only settable for UltraSSD + * disks. One operation can transfer between 4k and 256k bytes. + */ + @JsonProperty(value = "properties.diskIOPSReadWrite") + private Long diskIopsReadWrite; + + /* + * The bandwidth allowed for this disk; only settable for UltraSSD disks. + * MBps means millions of bytes per second - MB here uses the ISO notation, + * of powers of 10. + */ + @JsonProperty(value = "properties.diskMBpsReadWrite") + private Long diskMBpsReadWrite; + + /* + * The total number of IOPS that will be allowed across all VMs mounting + * the shared disk as ReadOnly. One operation can transfer between 4k and + * 256k bytes. + */ + @JsonProperty(value = "properties.diskIOPSReadOnly") + private Long diskIopsReadOnly; + + /* + * The total throughput (MBps) that will be allowed across all VMs mounting + * the shared disk as ReadOnly. MBps means millions of bytes per second - + * MB here uses the ISO notation, of powers of 10. + */ + @JsonProperty(value = "properties.diskMBpsReadOnly") + private Long diskMBpsReadOnly; + + /* + * The maximum number of VMs that can attach to the disk at the same time. + * Value greater than one indicates a disk that can be mounted on multiple + * VMs at the same time. + */ + @JsonProperty(value = "properties.maxShares") + private Integer maxShares; + + /* + * Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "properties.networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "properties.diskAccessId") + private String diskAccessId; + + /* + * Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does + * not apply to Ultra disks. + */ + @JsonProperty(value = "properties.tier") + private String tier; + + /* + * Set to true to enable bursting beyond the provisioned performance target + * of the disk. Bursting is disabled by default. Does not apply to Ultra + * disks. + */ + @JsonProperty(value = "properties.burstingEnabled") + private Boolean burstingEnabled; + + /* + * Purchase plan information to be added on the OS disk + */ + @JsonProperty(value = "properties.purchasePlan") + private PurchasePlanAutoGenerated purchasePlan; + + /* + * Properties of the disk for which update is pending. + */ + @JsonProperty(value = "properties.propertyUpdatesInProgress", access = JsonProperty.Access.WRITE_ONLY) + private PropertyUpdatesInProgress propertyUpdatesInProgress; + + /* + * Indicates the OS on a disk supports hibernation. + */ + @JsonProperty(value = "properties.supportsHibernation") + private Boolean supportsHibernation; + + /** + * 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 DiskUpdate object itself. + */ + public DiskUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * + * @return the sku value. + */ + public DiskSku sku() { + return this.sku; + } + + /** + * Set the sku property: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, + * Premium_ZRS, or StandardSSD_ZRS. + * + * @param sku the sku value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withSku(DiskSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the osType property: the Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: the Operating System type. + * + * @param osType the osType value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.encryptionSettingsCollection; + } + + /** + * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + this.encryptionSettingsCollection = encryptionSettingsCollection; + return this; + } + + /** + * Get the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. + * One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Set the diskIopsReadWrite property: The number of IOPS allowed for this disk; only settable for UltraSSD disks. + * One operation can transfer between 4k and 256k bytes. + * + * @param diskIopsReadWrite the diskIopsReadWrite value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskIopsReadWrite(Long diskIopsReadWrite) { + this.diskIopsReadWrite = diskIopsReadWrite; + return this; + } + + /** + * Get the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Set the diskMBpsReadWrite property: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps + * means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + * + * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + this.diskMBpsReadWrite = diskMBpsReadWrite; + return this; + } + + /** + * Get the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs mounting the + * shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * + * @return the diskIopsReadOnly value. + */ + public Long diskIopsReadOnly() { + return this.diskIopsReadOnly; + } + + /** + * Set the diskIopsReadOnly property: The total number of IOPS that will be allowed across all VMs mounting the + * shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + * + * @param diskIopsReadOnly the diskIopsReadOnly value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskIopsReadOnly(Long diskIopsReadOnly) { + this.diskIopsReadOnly = diskIopsReadOnly; + return this; + } + + /** + * Get the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + * 10. + * + * @return the diskMBpsReadOnly value. + */ + public Long diskMBpsReadOnly() { + return this.diskMBpsReadOnly; + } + + /** + * Set the diskMBpsReadOnly property: The total throughput (MBps) that will be allowed across all VMs mounting the + * shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + * 10. + * + * @param diskMBpsReadOnly the diskMBpsReadOnly value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskMBpsReadOnly(Long diskMBpsReadOnly) { + this.diskMBpsReadOnly = diskMBpsReadOnly; + return this; + } + + /** + * Get the maxShares property: The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * + * @return the maxShares value. + */ + public Integer maxShares() { + return this.maxShares; + } + + /** + * Set the maxShares property: The maximum number of VMs that can attach to the disk at the same time. Value greater + * than one indicates a disk that can be mounted on multiple VMs at the same time. + * + * @param maxShares the maxShares value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withMaxShares(Integer maxShares) { + this.maxShares = maxShares; + return this; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @param encryption the encryption value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.networkAccessPolicy; + } + + /** + * Set the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @param networkAccessPolicy the networkAccessPolicy value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + this.networkAccessPolicy = networkAccessPolicy; + return this; + } + + /** + * Get the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + public String diskAccessId() { + return this.diskAccessId; + } + + /** + * Set the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @param diskAccessId the diskAccessId value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Performance tier of the disk (e.g, P4, S10) as described here: + * https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + * + * @param tier the tier value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @return the burstingEnabled value. + */ + public Boolean burstingEnabled() { + return this.burstingEnabled; + } + + /** + * Set the burstingEnabled property: Set to true to enable bursting beyond the provisioned performance target of the + * disk. Bursting is disabled by default. Does not apply to Ultra disks. + * + * @param burstingEnabled the burstingEnabled value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withBurstingEnabled(Boolean burstingEnabled) { + this.burstingEnabled = burstingEnabled; + return this; + } + + /** + * Get the purchasePlan property: Purchase plan information to be added on the OS disk. + * + * @return the purchasePlan value. + */ + public PurchasePlanAutoGenerated purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Purchase plan information to be added on the OS disk. + * + * @param purchasePlan the purchasePlan value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withPurchasePlan(PurchasePlanAutoGenerated purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the propertyUpdatesInProgress property: Properties of the disk for which update is pending. + * + * @return the propertyUpdatesInProgress value. + */ + public PropertyUpdatesInProgress propertyUpdatesInProgress() { + return this.propertyUpdatesInProgress; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a disk supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the DiskUpdate object itself. + */ + public DiskUpdate withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (propertyUpdatesInProgress() != null) { + propertyUpdatesInProgress().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.java new file mode 100644 index 0000000000000..08ac518dc98ad --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disks.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 Disks. */ +public interface Disks { + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + Disk getByResourceGroup(String resourceGroupName, String diskName); + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String diskName); + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskName, Context context); + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the disks under 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 List Disks operation response. + */ + PagedIterable list(); + + /** + * Lists all the disks under 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 List Disks operation response. + */ + PagedIterable list(Context context); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData); + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String diskName); + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String diskName, Context context); + + /** + * Gets information about a disk. + * + * @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 information about a disk. + */ + Disk getById(String id); + + /** + * Gets information about a disk. + * + * @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 information about a disk. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a disk. + * + * @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 disk. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Disk resource. + * + * @param name resource name. + * @return the first stage of the new Disk definition. + */ + Disk.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.java new file mode 100644 index 0000000000000..4f518d184371c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Encryption.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption at rest settings for disk or snapshot. */ +@Fluent +public final class Encryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); + + /* + * ResourceId of the disk encryption set to use for enabling encryption at + * rest. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * The type of key used to encrypt the data of the disk. + */ + @JsonProperty(value = "type") + private EncryptionType type; + + /** + * Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at + * rest. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at + * rest. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the Encryption object itself. + */ + public Encryption withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the type property: The type of key used to encrypt the data of the disk. + * + * @return the type value. + */ + public EncryptionType type() { + return this.type; + } + + /** + * Set the type property: The type of key used to encrypt the data of the disk. + * + * @param type the type value to set. + * @return the Encryption object itself. + */ + public Encryption withType(EncryptionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionImages.java new file mode 100644 index 0000000000000..961e545e69f92 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionImages.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + */ +@Fluent +public final class EncryptionImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionImages.class); + + /* + * Contains encryption settings for an OS disk image. + */ + @JsonProperty(value = "osDiskImage") + private OSDiskImageEncryption osDiskImage; + + /* + * A list of encryption specifications for data disk images. + */ + @JsonProperty(value = "dataDiskImages") + private List dataDiskImages; + + /** + * Get the osDiskImage property: Contains encryption settings for an OS disk image. + * + * @return the osDiskImage value. + */ + public OSDiskImageEncryption osDiskImage() { + return this.osDiskImage; + } + + /** + * Set the osDiskImage property: Contains encryption settings for an OS disk image. + * + * @param osDiskImage the osDiskImage value to set. + * @return the EncryptionImages object itself. + */ + public EncryptionImages withOsDiskImage(OSDiskImageEncryption osDiskImage) { + this.osDiskImage = osDiskImage; + return this; + } + + /** + * Get the dataDiskImages property: A list of encryption specifications for data disk images. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Set the dataDiskImages property: A list of encryption specifications for data disk images. + * + * @param dataDiskImages the dataDiskImages value to set. + * @return the EncryptionImages object itself. + */ + public EncryptionImages withDataDiskImages(List dataDiskImages) { + this.dataDiskImages = dataDiskImages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java new file mode 100644 index 0000000000000..ee08fb3a2a412 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSetIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed identity for the disk encryption set. It should be given permission on the key vault before it can be + * used to encrypt disks. + */ +@Fluent +public class EncryptionSetIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSetIdentity.class); + + /* + * The type of Managed Identity used by the DiskEncryptionSet. Only + * SystemAssigned is supported for new creations. Disk Encryption Sets can + * be updated with Identity type None during migration of subscription to a + * new Azure Active Directory tenant; it will cause the encrypted resources + * to lose access to the keys. + */ + @JsonProperty(value = "type") + private DiskEncryptionSetIdentityType type; + + /* + * The object id of the Managed Identity Resource. This will be sent to the + * RP from ARM via the x-ms-identity-principal-id header in the PUT request + * if the resource has a systemAssigned(implicit) identity + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the Managed Identity Resource. This will be sent to the + * RP from ARM via the x-ms-client-tenant-id header in the PUT request if + * the resource has a systemAssigned(implicit) identity + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the type property: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + * supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of + * subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the + * keys. + * + * @return the type value. + */ + public DiskEncryptionSetIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + * supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of + * subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the + * keys. + * + * @param type the type value to set. + * @return the EncryptionSetIdentity object itself. + */ + public EncryptionSetIdentity withType(DiskEncryptionSetIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The object id of the Managed Identity Resource. This will be sent to the RP from + * ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) + * identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM + * via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.java new file mode 100644 index 0000000000000..5e0d4481fe080 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsCollection.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Encryption settings for disk or snapshot. */ +@Fluent +public final class EncryptionSettingsCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSettingsCollection.class); + + /* + * Set this flag to true and provide DiskEncryptionKey and optional + * KeyEncryptionKey to enable encryption. Set this flag to false and remove + * DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + * EncryptionSettings is null in the request object, the existing settings + * remain unchanged. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * A collection of encryption settings, one for each disk volume. + */ + @JsonProperty(value = "encryptionSettings") + private List encryptionSettings; + + /* + * Describes what type of encryption is used for the disks. Once this field + * is set, it cannot be overwritten. '1.0' corresponds to Azure Disk + * Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. + */ + @JsonProperty(value = "encryptionSettingsVersion") + private String encryptionSettingsVersion; + + /** + * Get the enabled property: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to + * enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable + * encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to + * enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable + * encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. + * + * @param enabled the enabled value to set. + * @return the EncryptionSettingsCollection object itself. + */ + public EncryptionSettingsCollection withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the encryptionSettings property: A collection of encryption settings, one for each disk volume. + * + * @return the encryptionSettings value. + */ + public List encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set the encryptionSettings property: A collection of encryption settings, one for each disk volume. + * + * @param encryptionSettings the encryptionSettings value to set. + * @return the EncryptionSettingsCollection object itself. + */ + public EncryptionSettingsCollection withEncryptionSettings(List encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get the encryptionSettingsVersion property: Describes what type of encryption is used for the disks. Once this + * field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds + * to Azure Disk Encryption. + * + * @return the encryptionSettingsVersion value. + */ + public String encryptionSettingsVersion() { + return this.encryptionSettingsVersion; + } + + /** + * Set the encryptionSettingsVersion property: Describes what type of encryption is used for the disks. Once this + * field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds + * to Azure Disk Encryption. + * + * @param encryptionSettingsVersion the encryptionSettingsVersion value to set. + * @return the EncryptionSettingsCollection object itself. + */ + public EncryptionSettingsCollection withEncryptionSettingsVersion(String encryptionSettingsVersion) { + this.encryptionSettingsVersion = encryptionSettingsVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.java new file mode 100644 index 0000000000000..d397b42f9c738 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionSettingsElement.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption settings for one disk volume. */ +@Fluent +public final class EncryptionSettingsElement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionSettingsElement.class); + + /* + * Key Vault Secret Url and vault id of the disk encryption key + */ + @JsonProperty(value = "diskEncryptionKey") + private KeyVaultAndSecretReference diskEncryptionKey; + + /* + * Key Vault Key Url and vault id of the key encryption key. + * KeyEncryptionKey is optional and when provided is used to unwrap the + * disk encryption key. + */ + @JsonProperty(value = "keyEncryptionKey") + private KeyVaultAndKeyReference keyEncryptionKey; + + /** + * Get the diskEncryptionKey property: Key Vault Secret Url and vault id of the disk encryption key. + * + * @return the diskEncryptionKey value. + */ + public KeyVaultAndSecretReference diskEncryptionKey() { + return this.diskEncryptionKey; + } + + /** + * Set the diskEncryptionKey property: Key Vault Secret Url and vault id of the disk encryption key. + * + * @param diskEncryptionKey the diskEncryptionKey value to set. + * @return the EncryptionSettingsElement object itself. + */ + public EncryptionSettingsElement withDiskEncryptionKey(KeyVaultAndSecretReference diskEncryptionKey) { + this.diskEncryptionKey = diskEncryptionKey; + return this; + } + + /** + * Get the keyEncryptionKey property: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is + * optional and when provided is used to unwrap the disk encryption key. + * + * @return the keyEncryptionKey value. + */ + public KeyVaultAndKeyReference keyEncryptionKey() { + return this.keyEncryptionKey; + } + + /** + * Set the keyEncryptionKey property: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is + * optional and when provided is used to unwrap the disk encryption key. + * + * @param keyEncryptionKey the keyEncryptionKey value to set. + * @return the EncryptionSettingsElement object itself. + */ + public EncryptionSettingsElement withKeyEncryptionKey(KeyVaultAndKeyReference keyEncryptionKey) { + this.keyEncryptionKey = keyEncryptionKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionKey() != null) { + diskEncryptionKey().validate(); + } + if (keyEncryptionKey() != null) { + keyEncryptionKey().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.java new file mode 100644 index 0000000000000..640fda2d66055 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/EncryptionType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionType. */ +public final class EncryptionType extends ExpandableStringEnum { + /** Static value EncryptionAtRestWithPlatformKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = + fromString("EncryptionAtRestWithPlatformKey"); + + /** Static value EncryptionAtRestWithCustomerKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = + fromString("EncryptionAtRestWithCustomerKey"); + + /** Static value EncryptionAtRestWithPlatformAndCustomerKeys for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = + fromString("EncryptionAtRestWithPlatformAndCustomerKeys"); + + /** + * Creates or finds a EncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionType. + */ + @JsonCreator + public static EncryptionType fromString(String name) { + return fromString(name, EncryptionType.class); + } + + /** @return known EncryptionType values. */ + public static Collection values() { + return values(EncryptionType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.java new file mode 100644 index 0000000000000..e812eac0e7dcb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExecutionState.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.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExecutionState. */ +public final class ExecutionState extends ExpandableStringEnum { + /** Static value Unknown for ExecutionState. */ + public static final ExecutionState UNKNOWN = fromString("Unknown"); + + /** Static value Pending for ExecutionState. */ + public static final ExecutionState PENDING = fromString("Pending"); + + /** Static value Running for ExecutionState. */ + public static final ExecutionState RUNNING = fromString("Running"); + + /** Static value Failed for ExecutionState. */ + public static final ExecutionState FAILED = fromString("Failed"); + + /** Static value Succeeded for ExecutionState. */ + public static final ExecutionState SUCCEEDED = fromString("Succeeded"); + + /** Static value TimedOut for ExecutionState. */ + public static final ExecutionState TIMED_OUT = fromString("TimedOut"); + + /** Static value Canceled for ExecutionState. */ + public static final ExecutionState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ExecutionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionState. + */ + @JsonCreator + public static ExecutionState fromString(String name) { + return fromString(name, ExecutionState.class); + } + + /** @return known ExecutionState values. */ + public static Collection values() { + return values(ExecutionState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java new file mode 100644 index 0000000000000..b4249daa15fd7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetCapacityReservationGroups.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypesForGetCapacityReservationGroups. */ +public final class ExpandTypesForGetCapacityReservationGroups + extends ExpandableStringEnum { + /** Static value virtualMachineScaleSetVMs/$ref for ExpandTypesForGetCapacityReservationGroups. */ + public static final ExpandTypesForGetCapacityReservationGroups VIRTUAL_MACHINE_SCALE_SET_VMS_REF = + fromString("virtualMachineScaleSetVMs/$ref"); + + /** Static value virtualMachines/$ref for ExpandTypesForGetCapacityReservationGroups. */ + public static final ExpandTypesForGetCapacityReservationGroups VIRTUAL_MACHINES_REF = + fromString("virtualMachines/$ref"); + + /** + * Creates or finds a ExpandTypesForGetCapacityReservationGroups from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypesForGetCapacityReservationGroups. + */ + @JsonCreator + public static ExpandTypesForGetCapacityReservationGroups fromString(String name) { + return fromString(name, ExpandTypesForGetCapacityReservationGroups.class); + } + + /** @return known ExpandTypesForGetCapacityReservationGroups values. */ + public static Collection values() { + return values(ExpandTypesForGetCapacityReservationGroups.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java new file mode 100644 index 0000000000000..2e321bd086db8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExpandTypesForGetVMScaleSets.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpandTypesForGetVMScaleSets. */ +public final class ExpandTypesForGetVMScaleSets extends ExpandableStringEnum { + /** Static value userData for ExpandTypesForGetVMScaleSets. */ + public static final ExpandTypesForGetVMScaleSets USER_DATA = fromString("userData"); + + /** + * Creates or finds a ExpandTypesForGetVMScaleSets from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpandTypesForGetVMScaleSets. + */ + @JsonCreator + public static ExpandTypesForGetVMScaleSets fromString(String name) { + return fromString(name, ExpandTypesForGetVMScaleSets.class); + } + + /** @return known ExpandTypesForGetVMScaleSets values. */ + public static Collection values() { + return values(ExpandTypesForGetVMScaleSets.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocation.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..2e2c785e68a7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocation.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..76db370afa463 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @return known ExtendedLocationTypes values. */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java new file mode 100644 index 0000000000000..861c60a7758a4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Extension.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service Extension. */ +@Fluent +public final class Extension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Extension.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Extension Properties. + */ + @JsonProperty(value = "properties") + private CloudServiceExtensionProperties properties; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the Extension object itself. + */ + public Extension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Extension Properties. + * + * @return the properties value. + */ + public CloudServiceExtensionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Extension Properties. + * + * @param properties the properties value to set. + * @return the Extension object itself. + */ + public Extension withProperties(CloudServiceExtensionProperties properties) { + this.properties = properties; + 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java new file mode 100644 index 0000000000000..1576ce1b23c3b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Galleries.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 Galleries. */ +public interface Galleries { + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + Gallery getByResourceGroup(String resourceGroupName, String galleryName); + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param select The select expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String galleryName, SelectPermissions select, Context context); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String galleryName); + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, Context context); + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List galleries under 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List galleries under a subscription. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + PagedIterable list(); + + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + PagedIterable list(Context context); + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + Gallery getById(String id); + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param id the resource ID. + * @param select The select expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + Response getByIdWithResponse(String id, SelectPermissions select, Context context); + + /** + * Delete a Shared Image Gallery. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Delete a Shared Image Gallery. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new Gallery resource. + * + * @param name resource name. + * @return the first stage of the new Gallery definition. + */ + Gallery.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java new file mode 100644 index 0000000000000..07da57ed372fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Gallery.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner; +import java.util.Map; + +/** An immutable client-side representation of Gallery. */ +public interface Gallery { + /** + * 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 description property: The description of this Shared Image Gallery resource. This property is updatable. + * + * @return the description value. + */ + String description(); + + /** + * Gets the identifier property: Describes the gallery unique name. + * + * @return the identifier value. + */ + GalleryIdentifier identifier(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryPropertiesProvisioningState provisioningState(); + + /** + * Gets the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + SharingProfile sharingProfile(); + + /** + * 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.compute.generated.fluent.models.GalleryInner object. + * + * @return the inner object. + */ + GalleryInner innerModel(); + + /** The entirety of the Gallery definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Gallery definition stages. */ + interface DefinitionStages { + /** The first stage of the Gallery definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Gallery 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 Gallery definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Gallery 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.WithDescription, + DefinitionStages.WithIdentifier, + DefinitionStages.WithSharingProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + Gallery create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Gallery create(Context context); + } + /** The stage of the Gallery 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 Gallery definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this Shared Image Gallery resource. This property + * is updatable.. + * + * @param description The description of this Shared Image Gallery resource. This property is updatable. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Gallery definition allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: Describes the gallery unique name.. + * + * @param identifier Describes the gallery unique name. + * @return the next definition stage. + */ + WithCreate withIdentifier(GalleryIdentifier identifier); + } + /** The stage of the Gallery definition allowing to specify sharingProfile. */ + interface WithSharingProfile { + /** + * Specifies the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @param sharingProfile Profile for gallery sharing to subscription or tenant. + * @return the next definition stage. + */ + WithCreate withSharingProfile(SharingProfile sharingProfile); + } + } + /** + * Begins update for the Gallery resource. + * + * @return the stage of resource update. + */ + Gallery.Update update(); + + /** The template for Gallery update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDescription, + UpdateStages.WithIdentifier, + UpdateStages.WithSharingProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Gallery apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Gallery apply(Context context); + } + /** The Gallery update stages. */ + interface UpdateStages { + /** The stage of the Gallery 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); + } + /** The stage of the Gallery update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this Shared Image Gallery resource. This property + * is updatable.. + * + * @param description The description of this Shared Image Gallery resource. This property is updatable. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Gallery update allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: Describes the gallery unique name.. + * + * @param identifier Describes the gallery unique name. + * @return the next definition stage. + */ + Update withIdentifier(GalleryIdentifier identifier); + } + /** The stage of the Gallery update allowing to specify sharingProfile. */ + interface WithSharingProfile { + /** + * Specifies the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @param sharingProfile Profile for gallery sharing to subscription or tenant. + * @return the next definition stage. + */ + Update withSharingProfile(SharingProfile sharingProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Gallery refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Gallery refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java new file mode 100644 index 0000000000000..a19cc727c41b4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplication.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of GalleryApplication. */ +public interface GalleryApplication { + /** + * 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 description property: The description of this gallery Application Definition resource. This property is + * updatable. + * + * @return the description value. + */ + String description(); + + /** + * Gets the eula property: The Eula agreement for the gallery Application Definition. + * + * @return the eula value. + */ + String eula(); + + /** + * Gets the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + String privacyStatementUri(); + + /** + * Gets the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + String releaseNoteUri(); + + /** + * Gets the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + OffsetDateTime endOfLifeDate(); + + /** + * Gets the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the supportedOSType value. + */ + OperatingSystemTypes supportedOSType(); + + /** + * 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.compute.generated.fluent.models.GalleryApplicationInner object. + * + * @return the inner object. + */ + GalleryApplicationInner innerModel(); + + /** The entirety of the GalleryApplication definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The GalleryApplication definition stages. */ + interface DefinitionStages { + /** The first stage of the GalleryApplication definition. */ + interface Blank extends WithLocation { + } + /** The stage of the GalleryApplication definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the GalleryApplication definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, galleryName. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to + * be created. + * @return the next definition stage. + */ + WithCreate withExistingGallery(String resourceGroupName, String galleryName); + } + /** + * The stage of the GalleryApplication 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.WithDescription, + DefinitionStages.WithEula, + DefinitionStages.WithPrivacyStatementUri, + DefinitionStages.WithReleaseNoteUri, + DefinitionStages.WithEndOfLifeDate, + DefinitionStages.WithSupportedOSType { + /** + * Executes the create request. + * + * @return the created resource. + */ + GalleryApplication create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GalleryApplication create(Context context); + } + /** The stage of the GalleryApplication 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 GalleryApplication definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this gallery Application Definition resource. This + * property is updatable.. + * + * @param description The description of this gallery Application Definition resource. This property is + * updatable. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the GalleryApplication definition allowing to specify eula. */ + interface WithEula { + /** + * Specifies the eula property: The Eula agreement for the gallery Application Definition.. + * + * @param eula The Eula agreement for the gallery Application Definition. + * @return the next definition stage. + */ + WithCreate withEula(String eula); + } + /** The stage of the GalleryApplication definition allowing to specify privacyStatementUri. */ + interface WithPrivacyStatementUri { + /** + * Specifies the privacyStatementUri property: The privacy statement uri.. + * + * @param privacyStatementUri The privacy statement uri. + * @return the next definition stage. + */ + WithCreate withPrivacyStatementUri(String privacyStatementUri); + } + /** The stage of the GalleryApplication definition allowing to specify releaseNoteUri. */ + interface WithReleaseNoteUri { + /** + * Specifies the releaseNoteUri property: The release note uri.. + * + * @param releaseNoteUri The release note uri. + * @return the next definition stage. + */ + WithCreate withReleaseNoteUri(String releaseNoteUri); + } + /** The stage of the GalleryApplication definition allowing to specify endOfLifeDate. */ + interface WithEndOfLifeDate { + /** + * Specifies the endOfLifeDate property: The end of life date of the gallery Application Definition. This + * property can be used for decommissioning purposes. This property is updatable.. + * + * @param endOfLifeDate The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * @return the next definition stage. + */ + WithCreate withEndOfLifeDate(OffsetDateTime endOfLifeDate); + } + /** The stage of the GalleryApplication definition allowing to specify supportedOSType. */ + interface WithSupportedOSType { + /** + * Specifies the supportedOSType property: This property allows you to specify the supported type of the OS + * that application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param supportedOSType This property allows you to specify the supported type of the OS that application + * is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * @return the next definition stage. + */ + WithCreate withSupportedOSType(OperatingSystemTypes supportedOSType); + } + } + /** + * Begins update for the GalleryApplication resource. + * + * @return the stage of resource update. + */ + GalleryApplication.Update update(); + + /** The template for GalleryApplication update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDescription, + UpdateStages.WithEula, + UpdateStages.WithPrivacyStatementUri, + UpdateStages.WithReleaseNoteUri, + UpdateStages.WithEndOfLifeDate, + UpdateStages.WithSupportedOSType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GalleryApplication apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GalleryApplication apply(Context context); + } + /** The GalleryApplication update stages. */ + interface UpdateStages { + /** The stage of the GalleryApplication 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); + } + /** The stage of the GalleryApplication update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this gallery Application Definition resource. This + * property is updatable.. + * + * @param description The description of this gallery Application Definition resource. This property is + * updatable. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the GalleryApplication update allowing to specify eula. */ + interface WithEula { + /** + * Specifies the eula property: The Eula agreement for the gallery Application Definition.. + * + * @param eula The Eula agreement for the gallery Application Definition. + * @return the next definition stage. + */ + Update withEula(String eula); + } + /** The stage of the GalleryApplication update allowing to specify privacyStatementUri. */ + interface WithPrivacyStatementUri { + /** + * Specifies the privacyStatementUri property: The privacy statement uri.. + * + * @param privacyStatementUri The privacy statement uri. + * @return the next definition stage. + */ + Update withPrivacyStatementUri(String privacyStatementUri); + } + /** The stage of the GalleryApplication update allowing to specify releaseNoteUri. */ + interface WithReleaseNoteUri { + /** + * Specifies the releaseNoteUri property: The release note uri.. + * + * @param releaseNoteUri The release note uri. + * @return the next definition stage. + */ + Update withReleaseNoteUri(String releaseNoteUri); + } + /** The stage of the GalleryApplication update allowing to specify endOfLifeDate. */ + interface WithEndOfLifeDate { + /** + * Specifies the endOfLifeDate property: The end of life date of the gallery Application Definition. This + * property can be used for decommissioning purposes. This property is updatable.. + * + * @param endOfLifeDate The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * @return the next definition stage. + */ + Update withEndOfLifeDate(OffsetDateTime endOfLifeDate); + } + /** The stage of the GalleryApplication update allowing to specify supportedOSType. */ + interface WithSupportedOSType { + /** + * Specifies the supportedOSType property: This property allows you to specify the supported type of the OS + * that application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param supportedOSType This property allows you to specify the supported type of the OS that application + * is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * @return the next definition stage. + */ + Update withSupportedOSType(OperatingSystemTypes supportedOSType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GalleryApplication refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GalleryApplication refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationList.java new file mode 100644 index 0000000000000..822911444c09a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationList.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Applications operation response. */ +@Fluent +public final class GalleryApplicationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationList.class); + + /* + * A list of Gallery Applications. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Application Definitions in the + * Application Gallery. Call ListNext() with this to fetch the next page of + * gallery Application Definitions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Gallery Applications. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Gallery Applications. + * + * @param value the value value to set. + * @return the GalleryApplicationList object itself. + */ + public GalleryApplicationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Application Definitions in the Application Gallery. + * Call ListNext() with this to fetch the next page of gallery Application Definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Application Definitions in the Application Gallery. + * Call ListNext() with this to fetch the next page of gallery Application Definitions. + * + * @param nextLink the nextLink value to set. + * @return the GalleryApplicationList object itself. + */ + public GalleryApplicationList 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 GalleryApplicationList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationUpdate.java new file mode 100644 index 0000000000000..a53e63092a437 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationUpdate.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Specifies information about the gallery Application Definition that you want to update. */ +@JsonFlatten +@Fluent +public class GalleryApplicationUpdate extends UpdateResourceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationUpdate.class); + + /* + * The description of this gallery Application Definition resource. This + * property is updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The Eula agreement for the gallery Application Definition. + */ + @JsonProperty(value = "properties.eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "properties.privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "properties.releaseNoteUri") + private String releaseNoteUri; + + /* + * The end of life date of the gallery Application Definition. This + * property can be used for decommissioning purposes. This property is + * updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This property allows you to specify the supported type of the OS that + * application is built for.

    Possible values are:

    + * **Windows**

    **Linux** + */ + @JsonProperty(value = "properties.supportedOSType") + private OperatingSystemTypes supportedOSType; + + /** + * Get the description property: The description of this gallery Application Definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this gallery Application Definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery Application Definition. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: The Eula agreement for the gallery Application Definition. + * + * @param eula the eula value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery Application Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the supportedOSType value. + */ + public OperatingSystemTypes supportedOSType() { + return this.supportedOSType; + } + + /** + * Set the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param supportedOSType the supportedOSType value to set. + * @return the GalleryApplicationUpdate object itself. + */ + public GalleryApplicationUpdate withSupportedOSType(OperatingSystemTypes supportedOSType) { + this.supportedOSType = supportedOSType; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersion.java new file mode 100644 index 0000000000000..c0c0d30eb9fa5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersion.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import java.util.Map; + +/** An immutable client-side representation of GalleryApplicationVersion. */ +public interface GalleryApplicationVersion { + /** + * 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 publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + GalleryApplicationVersionPublishingProfile publishingProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryApplicationVersionPropertiesProvisioningState provisioningState(); + + /** + * Gets the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + ReplicationStatus replicationStatus(); + + /** + * 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.compute.generated.fluent.models.GalleryApplicationVersionInner object. + * + * @return the inner object. + */ + GalleryApplicationVersionInner innerModel(); + + /** The entirety of the GalleryApplicationVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The GalleryApplicationVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the GalleryApplicationVersion definition. */ + interface Blank extends WithLocation { + } + /** The stage of the GalleryApplicationVersion definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the GalleryApplicationVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, galleryName, galleryApplicationName. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition + * resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application + * Version is to be created. + * @return the next definition stage. + */ + WithCreate withExistingApplication( + String resourceGroupName, String galleryName, String galleryApplicationName); + } + /** + * The stage of the GalleryApplicationVersion 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.WithPublishingProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + GalleryApplicationVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GalleryApplicationVersion create(Context context); + } + /** The stage of the GalleryApplicationVersion 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 GalleryApplicationVersion definition allowing to specify publishingProfile. */ + interface WithPublishingProfile { + /** + * Specifies the publishingProfile property: The publishing profile of a gallery image version.. + * + * @param publishingProfile The publishing profile of a gallery image version. + * @return the next definition stage. + */ + WithCreate withPublishingProfile(GalleryApplicationVersionPublishingProfile publishingProfile); + } + } + /** + * Begins update for the GalleryApplicationVersion resource. + * + * @return the stage of resource update. + */ + GalleryApplicationVersion.Update update(); + + /** The template for GalleryApplicationVersion update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithPublishingProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GalleryApplicationVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GalleryApplicationVersion apply(Context context); + } + /** The GalleryApplicationVersion update stages. */ + interface UpdateStages { + /** The stage of the GalleryApplicationVersion 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); + } + /** The stage of the GalleryApplicationVersion update allowing to specify publishingProfile. */ + interface WithPublishingProfile { + /** + * Specifies the publishingProfile property: The publishing profile of a gallery image version.. + * + * @param publishingProfile The publishing profile of a gallery image version. + * @return the next definition stage. + */ + Update withPublishingProfile(GalleryApplicationVersionPublishingProfile publishingProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GalleryApplicationVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GalleryApplicationVersion refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionList.java new file mode 100644 index 0000000000000..2c4cfa4bd44f1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionList.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Application version operation response. */ +@Fluent +public final class GalleryApplicationVersionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionList.class); + + /* + * A list of gallery Application Versions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of gallery Application Versions. Call + * ListNext() with this to fetch the next page of gallery Application + * Versions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of gallery Application Versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of gallery Application Versions. + * + * @param value the value value to set. + * @return the GalleryApplicationVersionList object itself. + */ + public GalleryApplicationVersionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of gallery Application Versions. Call ListNext() with + * this to fetch the next page of gallery Application Versions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of gallery Application Versions. Call ListNext() with + * this to fetch the next page of gallery Application Versions. + * + * @param nextLink the nextLink value to set. + * @return the GalleryApplicationVersionList object itself. + */ + public GalleryApplicationVersionList 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 GalleryApplicationVersionList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPropertiesProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPropertiesProvisioningState.java new file mode 100644 index 0000000000000..02e999d119eaa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPropertiesProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GalleryApplicationVersionPropertiesProvisioningState. */ +public final class GalleryApplicationVersionPropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for GalleryApplicationVersionPropertiesProvisioningState. */ + public static final GalleryApplicationVersionPropertiesProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates or finds a GalleryApplicationVersionPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryApplicationVersionPropertiesProvisioningState. + */ + @JsonCreator + public static GalleryApplicationVersionPropertiesProvisioningState fromString(String name) { + return fromString(name, GalleryApplicationVersionPropertiesProvisioningState.class); + } + + /** @return known GalleryApplicationVersionPropertiesProvisioningState values. */ + public static Collection values() { + return values(GalleryApplicationVersionPropertiesProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPublishingProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPublishingProfile.java new file mode 100644 index 0000000000000..d91f88e437541 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionPublishingProfile.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The publishing profile of a gallery image version. */ +@Fluent +public final class GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionPublishingProfile.class); + + /* + * The source image from which the Image Version is going to be created. + */ + @JsonProperty(value = "source", required = true) + private UserArtifactSource source; + + /* + * The manageActions property. + */ + @JsonProperty(value = "manageActions") + private UserArtifactManage manageActions; + + /* + * Optional. Whether or not this application reports health. + */ + @JsonProperty(value = "enableHealthCheck") + private Boolean enableHealthCheck; + + /** + * Get the source property: The source image from which the Image Version is going to be created. + * + * @return the source value. + */ + public UserArtifactSource source() { + return this.source; + } + + /** + * Set the source property: The source image from which the Image Version is going to be created. + * + * @param source the source value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withSource(UserArtifactSource source) { + this.source = source; + return this; + } + + /** + * Get the manageActions property: The manageActions property. + * + * @return the manageActions value. + */ + public UserArtifactManage manageActions() { + return this.manageActions; + } + + /** + * Set the manageActions property: The manageActions property. + * + * @param manageActions the manageActions value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withManageActions(UserArtifactManage manageActions) { + this.manageActions = manageActions; + return this; + } + + /** + * Get the enableHealthCheck property: Optional. Whether or not this application reports health. + * + * @return the enableHealthCheck value. + */ + public Boolean enableHealthCheck() { + return this.enableHealthCheck; + } + + /** + * Set the enableHealthCheck property: Optional. Whether or not this application reports health. + * + * @param enableHealthCheck the enableHealthCheck value to set. + * @return the GalleryApplicationVersionPublishingProfile object itself. + */ + public GalleryApplicationVersionPublishingProfile withEnableHealthCheck(Boolean enableHealthCheck) { + this.enableHealthCheck = enableHealthCheck; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withTargetRegions(List targetRegions) { + super.withTargetRegions(targetRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withReplicaCount(Integer replicaCount) { + super.withReplicaCount(replicaCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { + super.withExcludeFromLatest(excludeFromLatest); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + super.withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionPublishingProfile withStorageAccountType(StorageAccountType storageAccountType) { + super.withStorageAccountType(storageAccountType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property source in model GalleryApplicationVersionPublishingProfile")); + } else { + source().validate(); + } + if (manageActions() != null) { + manageActions().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionUpdate.java new file mode 100644 index 0000000000000..ce62d9b00d56b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersionUpdate.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery Application Version that you want to update. */ +@JsonFlatten +@Fluent +public class GalleryApplicationVersionUpdate extends UpdateResourceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionUpdate.class); + + /* + * The publishing profile of a gallery image version. + */ + @JsonProperty(value = "properties.publishingProfile") + private GalleryApplicationVersionPublishingProfile publishingProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryApplicationVersionPropertiesProvisioningState provisioningState; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "properties.replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryApplicationVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryApplicationVersionUpdate object itself. + */ + public GalleryApplicationVersionUpdate withPublishingProfile( + GalleryApplicationVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryApplicationVersionPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** {@inheritDoc} */ + @Override + public GalleryApplicationVersionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (publishingProfile() != null) { + publishingProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersions.java new file mode 100644 index 0000000000000..3f4149c3a04d7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplicationVersions.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 GalleryApplicationVersions. */ +public interface GalleryApplicationVersions { + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + GalleryApplicationVersion get( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName); + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName); + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context); + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName); + + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context); + + /** + * Retrieves information about a gallery Application Version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + GalleryApplicationVersion getById(String id); + + /** + * Retrieves information about a gallery Application Version. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + Response getByIdWithResponse(String id, ReplicationStatusTypes expand, Context context); + + /** + * Delete a gallery Application Version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Delete a gallery Application Version. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new GalleryApplicationVersion resource. + * + * @param name resource name. + * @return the first stage of the new GalleryApplicationVersion definition. + */ + GalleryApplicationVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplications.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplications.java new file mode 100644 index 0000000000000..fb4d18eda6697 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryApplications.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 GalleryApplications. */ +public interface GalleryApplications { + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + GalleryApplication get(String resourceGroupName, String galleryName, String galleryApplicationName); + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryApplicationName); + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryApplicationName, Context context); + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + PagedIterable listByGallery(String resourceGroupName, String galleryName); + + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); + + /** + * Retrieves information about a gallery Application Definition. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + GalleryApplication getById(String id); + + /** + * Retrieves information about a gallery Application Definition. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a gallery Application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Delete a gallery Application. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new GalleryApplication resource. + * + * @param name resource name. + * @return the first stage of the new GalleryApplication definition. + */ + GalleryApplication.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactPublishingProfileBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactPublishingProfileBase.java new file mode 100644 index 0000000000000..1708470d1714d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactPublishingProfileBase.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the basic gallery artifact publishing profile. */ +@Fluent +public class GalleryArtifactPublishingProfileBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryArtifactPublishingProfileBase.class); + + /* + * The target regions where the Image Version is going to be replicated to. + * This property is updatable. + */ + @JsonProperty(value = "targetRegions") + private List targetRegions; + + /* + * The number of replicas of the Image Version to be created per region. + * This property would take effect for a region when regionalReplicaCount + * is not specified. This property is updatable. + */ + @JsonProperty(value = "replicaCount") + private Integer replicaCount; + + /* + * If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + */ + @JsonProperty(value = "excludeFromLatest") + private Boolean excludeFromLatest; + + /* + * The timestamp for when the gallery image version is published. + */ + @JsonProperty(value = "publishedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime publishedDate; + + /* + * The end of life date of the gallery image version. This property can be + * used for decommissioning purposes. This property is updatable. + */ + @JsonProperty(value = "endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * Specifies the storage account type to be used to store the image. This + * property is not updatable. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountType storageAccountType; + + /** + * Get the targetRegions property: The target regions where the Image Version is going to be replicated to. This + * property is updatable. + * + * @return the targetRegions value. + */ + public List targetRegions() { + return this.targetRegions; + } + + /** + * Set the targetRegions property: The target regions where the Image Version is going to be replicated to. This + * property is updatable. + * + * @param targetRegions the targetRegions value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withTargetRegions(List targetRegions) { + this.targetRegions = targetRegions; + return this; + } + + /** + * Get the replicaCount property: The number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. + * + * @return the replicaCount value. + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the replicaCount property: The number of replicas of the Image Version to be created per region. This + * property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. + * + * @param replicaCount the replicaCount value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @return the excludeFromLatest value. + */ + public Boolean excludeFromLatest() { + return this.excludeFromLatest; + } + + /** + * Set the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the + * Image Definition won't use this Image Version. + * + * @param excludeFromLatest the excludeFromLatest value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withExcludeFromLatest(Boolean excludeFromLatest) { + this.excludeFromLatest = excludeFromLatest; + return this; + } + + /** + * Get the publishedDate property: The timestamp for when the gallery image version is published. + * + * @return the publishedDate value. + */ + public OffsetDateTime publishedDate() { + return this.publishedDate; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery image version. This property can be used for + * decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery image version. This property can be used for + * decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the storageAccountType property: Specifies the storage account type to be used to store the image. This + * property is not updatable. + * + * @return the storageAccountType value. + */ + public StorageAccountType storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type to be used to store the image. This + * property is not updatable. + * + * @param storageAccountType the storageAccountType value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withStorageAccountType(StorageAccountType storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetRegions() != null) { + targetRegions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionSource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionSource.java new file mode 100644 index 0000000000000..2c5b815ffd23b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryArtifactVersionSource.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The gallery artifact version source. */ +@Fluent +public final class GalleryArtifactVersionSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryArtifactVersionSource.class); + + /* + * The id of the gallery artifact version source. Can specify a disk uri, + * snapshot uri, user image or storage account resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The uri of the gallery artifact version source. Currently used to + * specify vhd/blob source. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Get the id property: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user + * image or storage account resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user + * image or storage account resource. + * + * @param id the id value to set. + * @return the GalleryArtifactVersionSource object itself. + */ + public GalleryArtifactVersionSource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the uri property: The uri of the gallery artifact version source. Currently used to specify vhd/blob source. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The uri of the gallery artifact version source. Currently used to specify vhd/blob source. + * + * @param uri the uri value to set. + * @return the GalleryArtifactVersionSource object itself. + */ + public GalleryArtifactVersionSource withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDataDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDataDiskImage.java new file mode 100644 index 0000000000000..517d92729a782 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDataDiskImage.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the data disk image. */ +@Fluent +public final class GalleryDataDiskImage extends GalleryDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryDataDiskImage.class); + + /* + * This property specifies the logical unit number of the data disk. This + * value is used to identify data disks within the Virtual Machine and + * therefore must be unique for each data disk attached to the Virtual + * Machine. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /** + * Get the lun property: This property specifies the logical unit number of the data disk. This value is used to + * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the + * Virtual Machine. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: This property specifies the logical unit number of the data disk. This value is used to + * identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the + * Virtual Machine. + * + * @param lun the lun value to set. + * @return the GalleryDataDiskImage object itself. + */ + public GalleryDataDiskImage withLun(int lun) { + this.lun = lun; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryDataDiskImage withHostCaching(HostCaching hostCaching) { + super.withHostCaching(hostCaching); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryDataDiskImage withSource(GalleryArtifactVersionSource source) { + super.withSource(source); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImage.java new file mode 100644 index 0000000000000..145d1f36de2a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryDiskImage.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the disk image base class. */ +@Fluent +public class GalleryDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryDiskImage.class); + + /* + * This property indicates the size of the VHD to be created. + */ + @JsonProperty(value = "sizeInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer sizeInGB; + + /* + * The host caching of the disk. Valid values are 'None', 'ReadOnly', and + * 'ReadWrite' + */ + @JsonProperty(value = "hostCaching") + private HostCaching hostCaching; + + /* + * The gallery artifact version source. + */ + @JsonProperty(value = "source") + private GalleryArtifactVersionSource source; + + /** + * Get the sizeInGB property: This property indicates the size of the VHD to be created. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Get the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. + * + * @return the hostCaching value. + */ + public HostCaching hostCaching() { + return this.hostCaching; + } + + /** + * Set the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. + * + * @param hostCaching the hostCaching value to set. + * @return the GalleryDiskImage object itself. + */ + public GalleryDiskImage withHostCaching(HostCaching hostCaching) { + this.hostCaching = hostCaching; + return this; + } + + /** + * Get the source property: The gallery artifact version source. + * + * @return the source value. + */ + public GalleryArtifactVersionSource source() { + return this.source; + } + + /** + * Set the source property: The gallery artifact version source. + * + * @param source the source value to set. + * @return the GalleryDiskImage object itself. + */ + public GalleryDiskImage withSource(GalleryArtifactVersionSource source) { + this.source = source; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryIdentifier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryIdentifier.java new file mode 100644 index 0000000000000..fd10a448b11e6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryIdentifier.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the gallery unique name. */ +@Immutable +public final class GalleryIdentifier { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryIdentifier.class); + + /* + * The unique name of the Shared Image Gallery. This name is generated + * automatically by Azure. + */ + @JsonProperty(value = "uniqueName", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueName; + + /** + * Get the uniqueName property: The unique name of the Shared Image Gallery. This name is generated automatically by + * Azure. + * + * @return the uniqueName value. + */ + public String uniqueName() { + return this.uniqueName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImage.java new file mode 100644 index 0000000000000..78fc1ec22d1d9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImage.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of GalleryImage. */ +public interface GalleryImage { + /** + * 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 description property: The description of this gallery image definition resource. This property is + * updatable. + * + * @return the description value. + */ + String description(); + + /** + * Gets the eula property: The Eula agreement for the gallery image definition. + * + * @return the eula value. + */ + String eula(); + + /** + * Gets the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + String privacyStatementUri(); + + /** + * Gets the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + String releaseNoteUri(); + + /** + * Gets the osType property: This property allows you to specify the type of the OS that is included in the disk + * when creating a VM from a managed image. <br><br> Possible values are: <br><br> + * **Windows** <br><br> **Linux**. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @return the osState value. + */ + OperatingSystemStateTypes osState(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + OffsetDateTime endOfLifeDate(); + + /** + * Gets the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + GalleryImageIdentifier identifier(); + + /** + * Gets the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @return the recommended value. + */ + RecommendedMachineConfiguration recommended(); + + /** + * Gets the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + Disallowed disallowed(); + + /** + * Gets the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @return the purchasePlan value. + */ + ImagePurchasePlan purchasePlan(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryImagePropertiesProvisioningState provisioningState(); + + /** + * Gets the features property: A list of gallery image features. + * + * @return the features value. + */ + List features(); + + /** + * 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.compute.generated.fluent.models.GalleryImageInner object. + * + * @return the inner object. + */ + GalleryImageInner innerModel(); + + /** The entirety of the GalleryImage definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The GalleryImage definition stages. */ + interface DefinitionStages { + /** The first stage of the GalleryImage definition. */ + interface Blank extends WithLocation { + } + /** The stage of the GalleryImage definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the GalleryImage definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, galleryName. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @return the next definition stage. + */ + WithCreate withExistingGallery(String resourceGroupName, String galleryName); + } + /** + * The stage of the GalleryImage 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.WithDescription, + DefinitionStages.WithEula, + DefinitionStages.WithPrivacyStatementUri, + DefinitionStages.WithReleaseNoteUri, + DefinitionStages.WithOsType, + DefinitionStages.WithOsState, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithEndOfLifeDate, + DefinitionStages.WithIdentifier, + DefinitionStages.WithRecommended, + DefinitionStages.WithDisallowed, + DefinitionStages.WithPurchasePlan, + DefinitionStages.WithFeatures { + /** + * Executes the create request. + * + * @return the created resource. + */ + GalleryImage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GalleryImage create(Context context); + } + /** The stage of the GalleryImage 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 GalleryImage definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this gallery image definition resource. This + * property is updatable.. + * + * @param description The description of this gallery image definition resource. This property is updatable. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the GalleryImage definition allowing to specify eula. */ + interface WithEula { + /** + * Specifies the eula property: The Eula agreement for the gallery image definition.. + * + * @param eula The Eula agreement for the gallery image definition. + * @return the next definition stage. + */ + WithCreate withEula(String eula); + } + /** The stage of the GalleryImage definition allowing to specify privacyStatementUri. */ + interface WithPrivacyStatementUri { + /** + * Specifies the privacyStatementUri property: The privacy statement uri.. + * + * @param privacyStatementUri The privacy statement uri. + * @return the next definition stage. + */ + WithCreate withPrivacyStatementUri(String privacyStatementUri); + } + /** The stage of the GalleryImage definition allowing to specify releaseNoteUri. */ + interface WithReleaseNoteUri { + /** + * Specifies the releaseNoteUri property: The release note uri.. + * + * @param releaseNoteUri The release note uri. + * @return the next definition stage. + */ + WithCreate withReleaseNoteUri(String releaseNoteUri); + } + /** The stage of the GalleryImage definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: This property allows you to specify the type of the OS that is included in + * the disk when creating a VM from a managed image. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @param osType This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> + * **Windows** <br><br> **Linux**. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + /** The stage of the GalleryImage definition allowing to specify osState. */ + interface WithOsState { + /** + * Specifies the osState property: This property allows the user to specify whether the virtual machines + * created under this image are 'Generalized' or 'Specialized'.. + * + * @param osState This property allows the user to specify whether the virtual machines created under this + * image are 'Generalized' or 'Specialized'. + * @return the next definition stage. + */ + WithCreate withOsState(OperatingSystemStateTypes osState); + } + /** The stage of the GalleryImage definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to + * OS disks only.. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + /** The stage of the GalleryImage definition allowing to specify endOfLifeDate. */ + interface WithEndOfLifeDate { + /** + * Specifies the endOfLifeDate property: The end of life date of the gallery image definition. This property + * can be used for decommissioning purposes. This property is updatable.. + * + * @param endOfLifeDate The end of life date of the gallery image definition. This property can be used for + * decommissioning purposes. This property is updatable. + * @return the next definition stage. + */ + WithCreate withEndOfLifeDate(OffsetDateTime endOfLifeDate); + } + /** The stage of the GalleryImage definition allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: This is the gallery image definition identifier.. + * + * @param identifier This is the gallery image definition identifier. + * @return the next definition stage. + */ + WithCreate withIdentifier(GalleryImageIdentifier identifier); + } + /** The stage of the GalleryImage definition allowing to specify recommended. */ + interface WithRecommended { + /** + * Specifies the recommended property: The properties describe the recommended machine configuration for + * this Image Definition. These properties are updatable.. + * + * @param recommended The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * @return the next definition stage. + */ + WithCreate withRecommended(RecommendedMachineConfiguration recommended); + } + /** The stage of the GalleryImage definition allowing to specify disallowed. */ + interface WithDisallowed { + /** + * Specifies the disallowed property: Describes the disallowed disk types.. + * + * @param disallowed Describes the disallowed disk types. + * @return the next definition stage. + */ + WithCreate withDisallowed(Disallowed disallowed); + } + /** The stage of the GalleryImage definition allowing to specify purchasePlan. */ + interface WithPurchasePlan { + /** + * Specifies the purchasePlan property: Describes the gallery image definition purchase plan. This is used + * by marketplace images.. + * + * @param purchasePlan Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * @return the next definition stage. + */ + WithCreate withPurchasePlan(ImagePurchasePlan purchasePlan); + } + /** The stage of the GalleryImage definition allowing to specify features. */ + interface WithFeatures { + /** + * Specifies the features property: A list of gallery image features.. + * + * @param features A list of gallery image features. + * @return the next definition stage. + */ + WithCreate withFeatures(List features); + } + } + /** + * Begins update for the GalleryImage resource. + * + * @return the stage of resource update. + */ + GalleryImage.Update update(); + + /** The template for GalleryImage update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDescription, + UpdateStages.WithEula, + UpdateStages.WithPrivacyStatementUri, + UpdateStages.WithReleaseNoteUri, + UpdateStages.WithOsType, + UpdateStages.WithOsState, + UpdateStages.WithHyperVGeneration, + UpdateStages.WithEndOfLifeDate, + UpdateStages.WithIdentifier, + UpdateStages.WithRecommended, + UpdateStages.WithDisallowed, + UpdateStages.WithPurchasePlan, + UpdateStages.WithFeatures { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GalleryImage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GalleryImage apply(Context context); + } + /** The GalleryImage update stages. */ + interface UpdateStages { + /** The stage of the GalleryImage 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); + } + /** The stage of the GalleryImage update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of this gallery image definition resource. This + * property is updatable.. + * + * @param description The description of this gallery image definition resource. This property is updatable. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the GalleryImage update allowing to specify eula. */ + interface WithEula { + /** + * Specifies the eula property: The Eula agreement for the gallery image definition.. + * + * @param eula The Eula agreement for the gallery image definition. + * @return the next definition stage. + */ + Update withEula(String eula); + } + /** The stage of the GalleryImage update allowing to specify privacyStatementUri. */ + interface WithPrivacyStatementUri { + /** + * Specifies the privacyStatementUri property: The privacy statement uri.. + * + * @param privacyStatementUri The privacy statement uri. + * @return the next definition stage. + */ + Update withPrivacyStatementUri(String privacyStatementUri); + } + /** The stage of the GalleryImage update allowing to specify releaseNoteUri. */ + interface WithReleaseNoteUri { + /** + * Specifies the releaseNoteUri property: The release note uri.. + * + * @param releaseNoteUri The release note uri. + * @return the next definition stage. + */ + Update withReleaseNoteUri(String releaseNoteUri); + } + /** The stage of the GalleryImage update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: This property allows you to specify the type of the OS that is included in + * the disk when creating a VM from a managed image. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @param osType This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> + * **Windows** <br><br> **Linux**. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + /** The stage of the GalleryImage update allowing to specify osState. */ + interface WithOsState { + /** + * Specifies the osState property: This property allows the user to specify whether the virtual machines + * created under this image are 'Generalized' or 'Specialized'.. + * + * @param osState This property allows the user to specify whether the virtual machines created under this + * image are 'Generalized' or 'Specialized'. + * @return the next definition stage. + */ + Update withOsState(OperatingSystemStateTypes osState); + } + /** The stage of the GalleryImage update allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to + * OS disks only.. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * @return the next definition stage. + */ + Update withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + /** The stage of the GalleryImage update allowing to specify endOfLifeDate. */ + interface WithEndOfLifeDate { + /** + * Specifies the endOfLifeDate property: The end of life date of the gallery image definition. This property + * can be used for decommissioning purposes. This property is updatable.. + * + * @param endOfLifeDate The end of life date of the gallery image definition. This property can be used for + * decommissioning purposes. This property is updatable. + * @return the next definition stage. + */ + Update withEndOfLifeDate(OffsetDateTime endOfLifeDate); + } + /** The stage of the GalleryImage update allowing to specify identifier. */ + interface WithIdentifier { + /** + * Specifies the identifier property: This is the gallery image definition identifier.. + * + * @param identifier This is the gallery image definition identifier. + * @return the next definition stage. + */ + Update withIdentifier(GalleryImageIdentifier identifier); + } + /** The stage of the GalleryImage update allowing to specify recommended. */ + interface WithRecommended { + /** + * Specifies the recommended property: The properties describe the recommended machine configuration for + * this Image Definition. These properties are updatable.. + * + * @param recommended The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * @return the next definition stage. + */ + Update withRecommended(RecommendedMachineConfiguration recommended); + } + /** The stage of the GalleryImage update allowing to specify disallowed. */ + interface WithDisallowed { + /** + * Specifies the disallowed property: Describes the disallowed disk types.. + * + * @param disallowed Describes the disallowed disk types. + * @return the next definition stage. + */ + Update withDisallowed(Disallowed disallowed); + } + /** The stage of the GalleryImage update allowing to specify purchasePlan. */ + interface WithPurchasePlan { + /** + * Specifies the purchasePlan property: Describes the gallery image definition purchase plan. This is used + * by marketplace images.. + * + * @param purchasePlan Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * @return the next definition stage. + */ + Update withPurchasePlan(ImagePurchasePlan purchasePlan); + } + /** The stage of the GalleryImage update allowing to specify features. */ + interface WithFeatures { + /** + * Specifies the features property: A list of gallery image features.. + * + * @param features A list of gallery image features. + * @return the next definition stage. + */ + Update withFeatures(List features); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GalleryImage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GalleryImage refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageFeature.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageFeature.java new file mode 100644 index 0000000000000..71dbf1e8b3944 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageFeature.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A feature for gallery image. */ +@Fluent +public final class GalleryImageFeature { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageFeature.class); + + /* + * The name of the gallery image feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value of the gallery image feature. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The name of the gallery image feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the gallery image feature. + * + * @param name the name value to set. + * @return the GalleryImageFeature object itself. + */ + public GalleryImageFeature withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the gallery image feature. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the gallery image feature. + * + * @param value the value value to set. + * @return the GalleryImageFeature object itself. + */ + public GalleryImageFeature withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageIdentifier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageIdentifier.java new file mode 100644 index 0000000000000..bbd4db39ce1a7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageIdentifier.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the gallery image definition identifier. */ +@Fluent +public final class GalleryImageIdentifier { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageIdentifier.class); + + /* + * The name of the gallery image definition publisher. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The name of the gallery image definition offer. + */ + @JsonProperty(value = "offer", required = true) + private String offer; + + /* + * The name of the gallery image definition SKU. + */ + @JsonProperty(value = "sku", required = true) + private String sku; + + /** + * Get the publisher property: The name of the gallery image definition publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the gallery image definition publisher. + * + * @param publisher the publisher value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: The name of the gallery image definition offer. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The name of the gallery image definition offer. + * + * @param offer the offer value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The name of the gallery image definition SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The name of the gallery image definition SKU. + * + * @param sku the sku value to set. + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model GalleryImageIdentifier")); + } + if (offer() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property offer in model GalleryImageIdentifier")); + } + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model GalleryImageIdentifier")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageList.java new file mode 100644 index 0000000000000..bb3b7fbc239f8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageList.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Images operation response. */ +@Fluent +public final class GalleryImageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageList.class); + + /* + * A list of Shared Image Gallery images. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Image Definitions in the Shared Image + * Gallery. Call ListNext() with this to fetch the next page of gallery + * image definitions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Shared Image Gallery images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Shared Image Gallery images. + * + * @param value the value value to set. + * @return the GalleryImageList object itself. + */ + public GalleryImageList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call + * ListNext() with this to fetch the next page of gallery image definitions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call + * ListNext() with this to fetch the next page of gallery image definitions. + * + * @param nextLink the nextLink value to set. + * @return the GalleryImageList object itself. + */ + public GalleryImageList 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 GalleryImageList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImagePropertiesProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImagePropertiesProvisioningState.java new file mode 100644 index 0000000000000..9852c086e495b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImagePropertiesProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GalleryImagePropertiesProvisioningState. */ +public final class GalleryImagePropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for GalleryImagePropertiesProvisioningState. */ + public static final GalleryImagePropertiesProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates or finds a GalleryImagePropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryImagePropertiesProvisioningState. + */ + @JsonCreator + public static GalleryImagePropertiesProvisioningState fromString(String name) { + return fromString(name, GalleryImagePropertiesProvisioningState.class); + } + + /** @return known GalleryImagePropertiesProvisioningState values. */ + public static Collection values() { + return values(GalleryImagePropertiesProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageUpdate.java new file mode 100644 index 0000000000000..395847eba9f08 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageUpdate.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Specifies information about the gallery image definition that you want to update. */ +@JsonFlatten +@Fluent +public class GalleryImageUpdate extends UpdateResourceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageUpdate.class); + + /* + * The description of this gallery image definition resource. This property + * is updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The Eula agreement for the gallery image definition. + */ + @JsonProperty(value = "properties.eula") + private String eula; + + /* + * The privacy statement uri. + */ + @JsonProperty(value = "properties.privacyStatementUri") + private String privacyStatementUri; + + /* + * The release note uri. + */ + @JsonProperty(value = "properties.releaseNoteUri") + private String releaseNoteUri; + + /* + * This property allows you to specify the type of the OS that is included + * in the disk when creating a VM from a managed image.

    Possible + * values are:

    **Windows**

    **Linux** + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * This property allows the user to specify whether the virtual machines + * created under this image are 'Generalized' or 'Specialized'. + */ + @JsonProperty(value = "properties.osState") + private OperatingSystemStateTypes osState; + + /* + * The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGeneration hyperVGeneration; + + /* + * The end of life date of the gallery image definition. This property can + * be used for decommissioning purposes. This property is updatable. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private OffsetDateTime endOfLifeDate; + + /* + * This is the gallery image definition identifier. + */ + @JsonProperty(value = "properties.identifier") + private GalleryImageIdentifier identifier; + + /* + * The properties describe the recommended machine configuration for this + * Image Definition. These properties are updatable. + */ + @JsonProperty(value = "properties.recommended") + private RecommendedMachineConfiguration recommended; + + /* + * Describes the disallowed disk types. + */ + @JsonProperty(value = "properties.disallowed") + private Disallowed disallowed; + + /* + * Describes the gallery image definition purchase plan. This is used by + * marketplace images. + */ + @JsonProperty(value = "properties.purchasePlan") + private ImagePurchasePlan purchasePlan; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImagePropertiesProvisioningState provisioningState; + + /* + * A list of gallery image features. + */ + @JsonProperty(value = "properties.features") + private List features; + + /** + * Get the description property: The description of this gallery image definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this gallery image definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eula property: The Eula agreement for the gallery image definition. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: The Eula agreement for the gallery image definition. + * + * @param eula the eula value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk when + * creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @return the osState value. + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @param osState the osState value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withOsState(OperatingSystemStateTypes osState) { + this.osState = osState; + return this; + } + + /** + * Get the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @return the hyperVGeneration value. + */ + public HyperVGeneration hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withHyperVGeneration(HyperVGeneration hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: This is the gallery image definition identifier. + * + * @param identifier the identifier value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @return the recommended value. + */ + public RecommendedMachineConfiguration recommended() { + return this.recommended; + } + + /** + * Set the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @param recommended the recommended value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withRecommended(RecommendedMachineConfiguration recommended) { + this.recommended = recommended; + return this; + } + + /** + * Get the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + public Disallowed disallowed() { + return this.disallowed; + } + + /** + * Set the disallowed property: Describes the disallowed disk types. + * + * @param disallowed the disallowed value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withDisallowed(Disallowed disallowed) { + this.disallowed = disallowed; + return this; + } + + /** + * Get the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @return the purchasePlan value. + */ + public ImagePurchasePlan purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @param purchasePlan the purchasePlan value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryImagePropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the features property: A list of gallery image features. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: A list of gallery image features. + * + * @param features the features value to set. + * @return the GalleryImageUpdate object itself. + */ + public GalleryImageUpdate withFeatures(List features) { + this.features = features; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identifier() != null) { + identifier().validate(); + } + if (recommended() != null) { + recommended().validate(); + } + if (disallowed() != null) { + disallowed().validate(); + } + if (purchasePlan() != null) { + purchasePlan().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersion.java new file mode 100644 index 0000000000000..bd4c0e485e48c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersion.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import java.util.Map; + +/** An immutable client-side representation of GalleryImageVersion. */ +public interface GalleryImageVersion { + /** + * 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 publishingProfile property: The publishing profile of a gallery image Version. + * + * @return the publishingProfile value. + */ + GalleryImageVersionPublishingProfile publishingProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + GalleryImageVersionPropertiesProvisioningState provisioningState(); + + /** + * Gets the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + GalleryImageVersionStorageProfile storageProfile(); + + /** + * Gets the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + ReplicationStatus replicationStatus(); + + /** + * 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.compute.generated.fluent.models.GalleryImageVersionInner object. + * + * @return the inner object. + */ + GalleryImageVersionInner innerModel(); + + /** The entirety of the GalleryImageVersion definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The GalleryImageVersion definition stages. */ + interface DefinitionStages { + /** The first stage of the GalleryImageVersion definition. */ + interface Blank extends WithLocation { + } + /** The stage of the GalleryImageVersion definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the GalleryImageVersion definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, galleryName, galleryImageName. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version is to be + * created. + * @return the next definition stage. + */ + WithCreate withExistingImage(String resourceGroupName, String galleryName, String galleryImageName); + } + /** + * The stage of the GalleryImageVersion 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.WithPublishingProfile, + DefinitionStages.WithStorageProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + GalleryImageVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GalleryImageVersion create(Context context); + } + /** The stage of the GalleryImageVersion 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 GalleryImageVersion definition allowing to specify publishingProfile. */ + interface WithPublishingProfile { + /** + * Specifies the publishingProfile property: The publishing profile of a gallery image Version.. + * + * @param publishingProfile The publishing profile of a gallery image Version. + * @return the next definition stage. + */ + WithCreate withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile); + } + /** The stage of the GalleryImageVersion definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: This is the storage profile of a Gallery Image Version.. + * + * @param storageProfile This is the storage profile of a Gallery Image Version. + * @return the next definition stage. + */ + WithCreate withStorageProfile(GalleryImageVersionStorageProfile storageProfile); + } + } + /** + * Begins update for the GalleryImageVersion resource. + * + * @return the stage of resource update. + */ + GalleryImageVersion.Update update(); + + /** The template for GalleryImageVersion update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithPublishingProfile, UpdateStages.WithStorageProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GalleryImageVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GalleryImageVersion apply(Context context); + } + /** The GalleryImageVersion update stages. */ + interface UpdateStages { + /** The stage of the GalleryImageVersion 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); + } + /** The stage of the GalleryImageVersion update allowing to specify publishingProfile. */ + interface WithPublishingProfile { + /** + * Specifies the publishingProfile property: The publishing profile of a gallery image Version.. + * + * @param publishingProfile The publishing profile of a gallery image Version. + * @return the next definition stage. + */ + Update withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile); + } + /** The stage of the GalleryImageVersion update allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: This is the storage profile of a Gallery Image Version.. + * + * @param storageProfile This is the storage profile of a Gallery Image Version. + * @return the next definition stage. + */ + Update withStorageProfile(GalleryImageVersionStorageProfile storageProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GalleryImageVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GalleryImageVersion refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionList.java new file mode 100644 index 0000000000000..d422f995d9d37 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Gallery Image version operation response. */ +@Fluent +public final class GalleryImageVersionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionList.class); + + /* + * A list of gallery image versions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of gallery image versions. Call + * ListNext() with this to fetch the next page of gallery image versions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of gallery image versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of gallery image versions. + * + * @param value the value value to set. + * @return the GalleryImageVersionList object itself. + */ + public GalleryImageVersionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of gallery image versions. Call ListNext() with this to + * fetch the next page of gallery image versions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of gallery image versions. Call ListNext() with this to + * fetch the next page of gallery image versions. + * + * @param nextLink the nextLink value to set. + * @return the GalleryImageVersionList object itself. + */ + public GalleryImageVersionList 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 GalleryImageVersionList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPropertiesProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPropertiesProvisioningState.java new file mode 100644 index 0000000000000..37e60ac8f5f95 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPropertiesProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GalleryImageVersionPropertiesProvisioningState. */ +public final class GalleryImageVersionPropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for GalleryImageVersionPropertiesProvisioningState. */ + public static final GalleryImageVersionPropertiesProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates or finds a GalleryImageVersionPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryImageVersionPropertiesProvisioningState. + */ + @JsonCreator + public static GalleryImageVersionPropertiesProvisioningState fromString(String name) { + return fromString(name, GalleryImageVersionPropertiesProvisioningState.class); + } + + /** @return known GalleryImageVersionPropertiesProvisioningState values. */ + public static Collection values() { + return values(GalleryImageVersionPropertiesProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPublishingProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPublishingProfile.java new file mode 100644 index 0000000000000..e43cbc7f662eb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionPublishingProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; +import java.util.List; + +/** The publishing profile of a gallery image Version. */ +@Fluent +public final class GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionPublishingProfile.class); + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withTargetRegions(List targetRegions) { + super.withTargetRegions(targetRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withReplicaCount(Integer replicaCount) { + super.withReplicaCount(replicaCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { + super.withExcludeFromLatest(excludeFromLatest); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + super.withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionPublishingProfile withStorageAccountType(StorageAccountType storageAccountType) { + super.withStorageAccountType(storageAccountType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionStorageProfile.java new file mode 100644 index 0000000000000..90d843f54023f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionStorageProfile.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the storage profile of a Gallery Image Version. */ +@Fluent +public final class GalleryImageVersionStorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionStorageProfile.class); + + /* + * The gallery artifact version source. + */ + @JsonProperty(value = "source") + private GalleryArtifactVersionSource source; + + /* + * This is the OS disk image. + */ + @JsonProperty(value = "osDiskImage") + private GalleryOSDiskImage osDiskImage; + + /* + * A list of data disk images. + */ + @JsonProperty(value = "dataDiskImages") + private List dataDiskImages; + + /** + * Get the source property: The gallery artifact version source. + * + * @return the source value. + */ + public GalleryArtifactVersionSource source() { + return this.source; + } + + /** + * Set the source property: The gallery artifact version source. + * + * @param source the source value to set. + * @return the GalleryImageVersionStorageProfile object itself. + */ + public GalleryImageVersionStorageProfile withSource(GalleryArtifactVersionSource source) { + this.source = source; + return this; + } + + /** + * Get the osDiskImage property: This is the OS disk image. + * + * @return the osDiskImage value. + */ + public GalleryOSDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Set the osDiskImage property: This is the OS disk image. + * + * @param osDiskImage the osDiskImage value to set. + * @return the GalleryImageVersionStorageProfile object itself. + */ + public GalleryImageVersionStorageProfile withOsDiskImage(GalleryOSDiskImage osDiskImage) { + this.osDiskImage = osDiskImage; + return this; + } + + /** + * Get the dataDiskImages property: A list of data disk images. + * + * @return the dataDiskImages value. + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + + /** + * Set the dataDiskImages property: A list of data disk images. + * + * @param dataDiskImages the dataDiskImages value to set. + * @return the GalleryImageVersionStorageProfile object itself. + */ + public GalleryImageVersionStorageProfile withDataDiskImages(List dataDiskImages) { + this.dataDiskImages = dataDiskImages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (osDiskImage() != null) { + osDiskImage().validate(); + } + if (dataDiskImages() != null) { + dataDiskImages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionUpdate.java new file mode 100644 index 0000000000000..1c647c44bbca3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersionUpdate.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the gallery image version that you want to update. */ +@JsonFlatten +@Fluent +public class GalleryImageVersionUpdate extends UpdateResourceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageVersionUpdate.class); + + /* + * The publishing profile of a gallery image Version. + */ + @JsonProperty(value = "properties.publishingProfile") + private GalleryImageVersionPublishingProfile publishingProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImageVersionPropertiesProvisioningState provisioningState; + + /* + * This is the storage profile of a Gallery Image Version. + */ + @JsonProperty(value = "properties.storageProfile") + private GalleryImageVersionStorageProfile storageProfile; + + /* + * This is the replication status of the gallery image version. + */ + @JsonProperty(value = "properties.replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** + * Get the publishingProfile property: The publishing profile of a gallery image Version. + * + * @return the publishingProfile value. + */ + public GalleryImageVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image Version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryImageVersionUpdate object itself. + */ + public GalleryImageVersionUpdate withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryImageVersionPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @return the storageProfile value. + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: This is the storage profile of a Gallery Image Version. + * + * @param storageProfile the storageProfile value to set. + * @return the GalleryImageVersionUpdate object itself. + */ + public GalleryImageVersionUpdate withStorageProfile(GalleryImageVersionStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** {@inheritDoc} */ + @Override + public GalleryImageVersionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (publishingProfile() != null) { + publishingProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersions.java new file mode 100644 index 0000000000000..e9e61c5b20eb5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImageVersions.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 GalleryImageVersions. */ +public interface GalleryImageVersions { + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + GalleryImageVersion get( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName); + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be retrieved. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + Response getWithResponse( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName, String galleryImageVersionName); + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery image version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context); + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName); + + /** + * List gallery image versions in a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName, Context context); + + /** + * Retrieves information about a gallery image version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + GalleryImageVersion getById(String id); + + /** + * Retrieves information about a gallery image version. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image version that you want to create or update. + */ + Response getByIdWithResponse(String id, ReplicationStatusTypes expand, Context context); + + /** + * Delete a gallery image version. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Delete a gallery image version. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new GalleryImageVersion resource. + * + * @param name resource name. + * @return the first stage of the new GalleryImageVersion definition. + */ + GalleryImageVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImages.java new file mode 100644 index 0000000000000..4e8a042fe96be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryImages.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 GalleryImages. */ +public interface GalleryImages { + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + GalleryImage get(String resourceGroupName, String galleryName, String galleryImageName); + + /** + * Retrieves information about a gallery image definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery image definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + Response getWithResponse( + String resourceGroupName, String galleryName, String galleryImageName, Context context); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName); + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery image definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 galleryName, String galleryImageName, Context context); + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + PagedIterable listByGallery(String resourceGroupName, String galleryName); + + /** + * List gallery image definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); + + /** + * Retrieves information about a gallery image definition. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + GalleryImage getById(String id); + + /** + * Retrieves information about a gallery image definition. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery image definition that you want to create or update. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a gallery image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * Delete a gallery image. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new GalleryImage resource. + * + * @param name resource name. + * @return the first stage of the new GalleryImage definition. + */ + GalleryImage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryList.java new file mode 100644 index 0000000000000..df60391645c12 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Galleries operation response. */ +@Fluent +public final class GalleryList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryList.class); + + /* + * A list of galleries. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of galleries. Call ListNext() with this + * to fetch the next page of galleries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of galleries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of galleries. + * + * @param value the value value to set. + * @return the GalleryList object itself. + */ + public GalleryList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of galleries. Call ListNext() with this to fetch the + * next page of galleries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of galleries. Call ListNext() with this to fetch the + * next page of galleries. + * + * @param nextLink the nextLink value to set. + * @return the GalleryList object itself. + */ + public GalleryList 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 GalleryList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryOSDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryOSDiskImage.java new file mode 100644 index 0000000000000..a55d45e0e3cb4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryOSDiskImage.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** This is the OS disk image. */ +@Fluent +public final class GalleryOSDiskImage extends GalleryDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryOSDiskImage.class); + + /** {@inheritDoc} */ + @Override + public GalleryOSDiskImage withHostCaching(HostCaching hostCaching) { + super.withHostCaching(hostCaching); + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryOSDiskImage withSource(GalleryArtifactVersionSource source) { + super.withSource(source); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryPropertiesProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryPropertiesProvisioningState.java new file mode 100644 index 0000000000000..7d10b29156419 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryPropertiesProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GalleryPropertiesProvisioningState. */ +public final class GalleryPropertiesProvisioningState extends ExpandableStringEnum { + /** Static value Creating for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for GalleryPropertiesProvisioningState. */ + public static final GalleryPropertiesProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates or finds a GalleryPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryPropertiesProvisioningState. + */ + @JsonCreator + public static GalleryPropertiesProvisioningState fromString(String name) { + return fromString(name, GalleryPropertiesProvisioningState.class); + } + + /** @return known GalleryPropertiesProvisioningState values. */ + public static Collection values() { + return values(GalleryPropertiesProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingPermissionTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingPermissionTypes.java new file mode 100644 index 0000000000000..a456bd009b7ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingPermissionTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GallerySharingPermissionTypes. */ +public final class GallerySharingPermissionTypes extends ExpandableStringEnum { + /** Static value Private for GallerySharingPermissionTypes. */ + public static final GallerySharingPermissionTypes PRIVATE = fromString("Private"); + + /** Static value Groups for GallerySharingPermissionTypes. */ + public static final GallerySharingPermissionTypes GROUPS = fromString("Groups"); + + /** + * Creates or finds a GallerySharingPermissionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding GallerySharingPermissionTypes. + */ + @JsonCreator + public static GallerySharingPermissionTypes fromString(String name) { + return fromString(name, GallerySharingPermissionTypes.class); + } + + /** @return known GallerySharingPermissionTypes values. */ + public static Collection values() { + return values(GallerySharingPermissionTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingProfiles.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingProfiles.java new file mode 100644 index 0000000000000..4bc80fe16532a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GallerySharingProfiles.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; + +/** Resource collection API of GallerySharingProfiles. */ +public interface GallerySharingProfiles { + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + SharingUpdate update(String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate); + + /** + * Update sharing profile of a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param sharingUpdate Parameters supplied to the update gallery sharing profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery sharing profile update. + */ + SharingUpdate update( + String resourceGroupName, String galleryName, SharingUpdateInner sharingUpdate, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryUpdate.java new file mode 100644 index 0000000000000..bdc8979808432 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GalleryUpdate.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the Shared Image Gallery that you want to update. */ +@JsonFlatten +@Fluent +public class GalleryUpdate extends UpdateResourceDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryUpdate.class); + + /* + * The description of this Shared Image Gallery resource. This property is + * updatable. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Describes the gallery unique name. + */ + @JsonProperty(value = "properties.identifier") + private GalleryIdentifier identifier; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GalleryPropertiesProvisioningState provisioningState; + + /* + * Profile for gallery sharing to subscription or tenant + */ + @JsonProperty(value = "properties.sharingProfile") + private SharingProfile sharingProfile; + + /** + * Get the description property: The description of this Shared Image Gallery resource. This property is updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this Shared Image Gallery resource. This property is updatable. + * + * @param description the description value to set. + * @return the GalleryUpdate object itself. + */ + public GalleryUpdate withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the identifier property: Describes the gallery unique name. + * + * @return the identifier value. + */ + public GalleryIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Describes the gallery unique name. + * + * @param identifier the identifier value to set. + * @return the GalleryUpdate object itself. + */ + public GalleryUpdate withIdentifier(GalleryIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @return the sharingProfile value. + */ + public SharingProfile sharingProfile() { + return this.sharingProfile; + } + + /** + * Set the sharingProfile property: Profile for gallery sharing to subscription or tenant. + * + * @param sharingProfile the sharingProfile value to set. + * @return the GalleryUpdate object itself. + */ + public GalleryUpdate withSharingProfile(SharingProfile sharingProfile) { + this.sharingProfile = sharingProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public GalleryUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (identifier() != null) { + identifier().validate(); + } + if (sharingProfile() != null) { + sharingProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GrantAccessData.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GrantAccessData.java new file mode 100644 index 0000000000000..66c95dd28b762 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/GrantAccessData.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data used for requesting a SAS. */ +@Fluent +public final class GrantAccessData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GrantAccessData.class); + + /* + * The access property. + */ + @JsonProperty(value = "access", required = true) + private AccessLevel access; + + /* + * Time duration in seconds until the SAS access expires. + */ + @JsonProperty(value = "durationInSeconds", required = true) + private int durationInSeconds; + + /** + * Get the access property: The access property. + * + * @return the access value. + */ + public AccessLevel access() { + return this.access; + } + + /** + * Set the access property: The access property. + * + * @param access the access value to set. + * @return the GrantAccessData object itself. + */ + public GrantAccessData withAccess(AccessLevel access) { + this.access = access; + return this; + } + + /** + * Get the durationInSeconds property: Time duration in seconds until the SAS access expires. + * + * @return the durationInSeconds value. + */ + public int durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Set the durationInSeconds property: Time duration in seconds until the SAS access expires. + * + * @param durationInSeconds the durationInSeconds value to set. + * @return the GrantAccessData object itself. + */ + public GrantAccessData withDurationInSeconds(int durationInSeconds) { + this.durationInSeconds = durationInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (access() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property access in model GrantAccessData")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.java new file mode 100644 index 0000000000000..f113c6b46185b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the hardware settings for the virtual machine. */ +@Fluent +public final class HardwareProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HardwareProfile.class); + + /* + * Specifies the size of the virtual machine.

    The enum data type + * is currently deprecated and will be removed by December 23rd 2023. + *

    Recommended way to get the list of available sizes is using + * these APIs:

    [List all available virtual machine sizes in an + * availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a region]( + * https://docs.microsoft.com/rest/api/compute/resourceskus/list)

    + * [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * For more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). + *

    The available VM sizes depend on region and availability set. + */ + @JsonProperty(value = "vmSize") + private VirtualMachineSizeTypes vmSize; + + /** + * Get the vmSize property: Specifies the size of the virtual machine. <br><br> The enum data type is + * currently deprecated and will be removed by December 23rd 2023. <br><br> Recommended way to get the + * list of available sizes is using these APIs: <br><br> [List all available virtual machine sizes in an + * availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + * <br><br> [List all available virtual machine sizes in a region]( + * https://docs.microsoft.com/rest/api/compute/resourceskus/list) <br><br> [List all available virtual + * machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For + * more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). <br><br> The available VM sizes + * depend on region and availability set. + * + * @return the vmSize value. + */ + public VirtualMachineSizeTypes vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Specifies the size of the virtual machine. <br><br> The enum data type is + * currently deprecated and will be removed by December 23rd 2023. <br><br> Recommended way to get the + * list of available sizes is using these APIs: <br><br> [List all available virtual machine sizes in an + * availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + * <br><br> [List all available virtual machine sizes in a region]( + * https://docs.microsoft.com/rest/api/compute/resourceskus/list) <br><br> [List all available virtual + * machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For + * more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/sizes). <br><br> The available VM sizes + * depend on region and availability set. + * + * @param vmSize the vmSize value to set. + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HostCaching.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HostCaching.java new file mode 100644 index 0000000000000..16fb1ee7308de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HostCaching.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HostCaching. */ +public enum HostCaching { + /** Enum value None. */ + NONE("None"), + + /** Enum value ReadOnly. */ + READ_ONLY("ReadOnly"), + + /** Enum value ReadWrite. */ + READ_WRITE("ReadWrite"); + + /** The actual serialized value for a HostCaching instance. */ + private final String value; + + HostCaching(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HostCaching instance. + * + * @param value the serialized value to parse. + * @return the parsed HostCaching object, or null if unable to parse. + */ + @JsonCreator + public static HostCaching fromString(String value) { + HostCaching[] items = HostCaching.values(); + for (HostCaching item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGeneration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGeneration.java new file mode 100644 index 0000000000000..5bbae09840d6e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGeneration.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HyperVGeneration. */ +public final class HyperVGeneration extends ExpandableStringEnum { + /** Static value V1 for HyperVGeneration. */ + public static final HyperVGeneration V1 = fromString("V1"); + + /** Static value V2 for HyperVGeneration. */ + public static final HyperVGeneration V2 = fromString("V2"); + + /** + * Creates or finds a HyperVGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVGeneration. + */ + @JsonCreator + public static HyperVGeneration fromString(String name) { + return fromString(name, HyperVGeneration.class); + } + + /** @return known HyperVGeneration values. */ + public static Collection values() { + return values(HyperVGeneration.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationType.java new file mode 100644 index 0000000000000..0fd88af98b236 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HyperVGenerationType. */ +public final class HyperVGenerationType extends ExpandableStringEnum { + /** Static value V1 for HyperVGenerationType. */ + public static final HyperVGenerationType V1 = fromString("V1"); + + /** Static value V2 for HyperVGenerationType. */ + public static final HyperVGenerationType V2 = fromString("V2"); + + /** + * Creates or finds a HyperVGenerationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVGenerationType. + */ + @JsonCreator + public static HyperVGenerationType fromString(String name) { + return fromString(name, HyperVGenerationType.class); + } + + /** @return known HyperVGenerationType values. */ + public static Collection values() { + return values(HyperVGenerationType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationTypes.java new file mode 100644 index 0000000000000..59379477e1ad8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HyperVGenerationTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HyperVGenerationTypes. */ +public final class HyperVGenerationTypes extends ExpandableStringEnum { + /** Static value V1 for HyperVGenerationTypes. */ + public static final HyperVGenerationTypes V1 = fromString("V1"); + + /** Static value V2 for HyperVGenerationTypes. */ + public static final HyperVGenerationTypes V2 = fromString("V2"); + + /** + * Creates or finds a HyperVGenerationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding HyperVGenerationTypes. + */ + @JsonCreator + public static HyperVGenerationTypes fromString(String name) { + return fromString(name, HyperVGenerationTypes.class); + } + + /** @return known HyperVGenerationTypes values. */ + public static Collection values() { + return values(HyperVGenerationTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.java new file mode 100644 index 0000000000000..b4e697d28fd55 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import java.util.Map; + +/** An immutable client-side representation of Image. */ +public interface Image { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the Image. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + SubResource sourceVirtualMachine(); + + /** + * Gets the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + ImageStorageProfile storageProfile(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + HyperVGenerationTypes hyperVGeneration(); + + /** + * 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.compute.generated.fluent.models.ImageInner object. + * + * @return the inner object. + */ + ImageInner innerModel(); + + /** The entirety of the Image definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Image definition stages. */ + interface DefinitionStages { + /** The first stage of the Image definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Image 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 Image definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Image 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.WithSourceVirtualMachine, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithHyperVGeneration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Image create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Image create(Context context); + } + /** The stage of the Image 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 Image definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Image.. + * + * @param extendedLocation The extended location of the Image. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Image definition allowing to specify sourceVirtualMachine. */ + interface WithSourceVirtualMachine { + /** + * Specifies the sourceVirtualMachine property: The source virtual machine from which Image is created.. + * + * @param sourceVirtualMachine The source virtual machine from which Image is created. + * @return the next definition stage. + */ + WithCreate withSourceVirtualMachine(SubResource sourceVirtualMachine); + } + /** The stage of the Image definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + WithCreate withStorageProfile(ImageStorageProfile storageProfile); + } + /** The stage of the Image definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created + * from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to + * specify the value, if the source is managed resource like disk or snapshot, we may require the user to + * specify the property if we cannot deduce it from the source managed resource.. + * + * @param hyperVGeneration Specifies the HyperVGenerationType of the VirtualMachine created from the image. + * From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the + * value, if the source is managed resource like disk or snapshot, we may require the user to specify + * the property if we cannot deduce it from the source managed resource. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGenerationTypes hyperVGeneration); + } + } + /** + * Begins update for the Image resource. + * + * @return the stage of resource update. + */ + Image.Update update(); + + /** The template for Image update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSourceVirtualMachine, + UpdateStages.WithStorageProfile, + UpdateStages.WithHyperVGeneration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Image apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Image apply(Context context); + } + /** The Image update stages. */ + interface UpdateStages { + /** The stage of the Image 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); + } + /** The stage of the Image update allowing to specify sourceVirtualMachine. */ + interface WithSourceVirtualMachine { + /** + * Specifies the sourceVirtualMachine property: The source virtual machine from which Image is created.. + * + * @param sourceVirtualMachine The source virtual machine from which Image is created. + * @return the next definition stage. + */ + Update withSourceVirtualMachine(SubResource sourceVirtualMachine); + } + /** The stage of the Image update allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + Update withStorageProfile(ImageStorageProfile storageProfile); + } + /** The stage of the Image update allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created + * from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to + * specify the value, if the source is managed resource like disk or snapshot, we may require the user to + * specify the property if we cannot deduce it from the source managed resource.. + * + * @param hyperVGeneration Specifies the HyperVGenerationType of the VirtualMachine created from the image. + * From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the + * value, if the source is managed resource like disk or snapshot, we may require the user to specify + * the property if we cannot deduce it from the source managed resource. + * @return the next definition stage. + */ + Update withHyperVGeneration(HyperVGenerationTypes hyperVGeneration); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Image refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Image refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java new file mode 100644 index 0000000000000..f333e39c55e91 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDataDisk.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class ImageDataDisk extends ImageDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDataDisk.class); + + /* + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /** + * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @param lun the lun value to set. + * @return the ImageDataDisk object itself. + */ + public ImageDataDisk withLun(int lun) { + this.lun = lun; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withSnapshot(SubResource snapshot) { + super.withSnapshot(snapshot); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withManagedDisk(SubResource managedDisk) { + super.withManagedDisk(managedDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withBlobUri(String blobUri) { + super.withBlobUri(blobUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withCaching(CachingTypes caching) { + super.withCaching(caching); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withDiskSizeGB(Integer diskSizeGB) { + super.withDiskSizeGB(diskSizeGB); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withStorageAccountType(StorageAccountTypes storageAccountType) { + super.withStorageAccountType(storageAccountType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageDataDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + super.withDiskEncryptionSet(diskEncryptionSet); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDisk.java new file mode 100644 index 0000000000000..d317d50088bc4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDisk.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a image disk. */ +@Fluent +public class ImageDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDisk.class); + + /* + * The snapshot. + */ + @JsonProperty(value = "snapshot") + private SubResource snapshot; + + /* + * The managedDisk. + */ + @JsonProperty(value = "managedDisk") + private SubResource managedDisk; + + /* + * The Virtual Hard Disk. + */ + @JsonProperty(value = "blobUri") + private String blobUri; + + /* + * Specifies the caching requirements.

    Possible values are: + *

    **None**

    **ReadOnly**

    **ReadWrite**

    + * Default: **None for Standard storage. ReadOnly for Premium storage** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies the size of empty data disks in gigabytes. This element can be + * used to overwrite the name of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the + * managed image disk. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /** + * Get the snapshot property: The snapshot. + * + * @return the snapshot value. + */ + public SubResource snapshot() { + return this.snapshot; + } + + /** + * Set the snapshot property: The snapshot. + * + * @param snapshot the snapshot value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withSnapshot(SubResource snapshot) { + this.snapshot = snapshot; + return this; + } + + /** + * Get the managedDisk property: The managedDisk. + * + * @return the managedDisk value. + */ + public SubResource managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managedDisk. + * + * @param managedDisk the managedDisk value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withManagedDisk(SubResource managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the blobUri property: The Virtual Hard Disk. + * + * @return the blobUri value. + */ + public String blobUri() { + return this.blobUri; + } + + /** + * Set the blobUri property: The Virtual Hard Disk. + * + * @param blobUri the blobUri value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withBlobUri(String blobUri) { + this.blobUri = blobUri; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @param caching the caching value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of empty data disks in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of empty data disks in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @return the storageAccountType value. + */ + public StorageAccountTypes storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @param storageAccountType the storageAccountType value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withStorageAccountType(StorageAccountTypes storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed image disk. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed image disk. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the ImageDisk object itself. + */ + public ImageDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDiskReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDiskReference.java new file mode 100644 index 0000000000000..6efe6d49ba499 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageDiskReference.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The source image used for creating the disk. */ +@Fluent +public final class ImageDiskReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageDiskReference.class); + + /* + * A relative uri containing either a Platform Image Repository or user + * image reference. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * If the disk is created from an image's data disk, this is an index that + * indicates which of the data disks in the image to use. For OS disks, + * this field is null. + */ + @JsonProperty(value = "lun") + private Integer lun; + + /** + * Get the id property: A relative uri containing either a Platform Image Repository or user image reference. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A relative uri containing either a Platform Image Repository or user image reference. + * + * @param id the id value to set. + * @return the ImageDiskReference object itself. + */ + public ImageDiskReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the lun property: If the disk is created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Set the lun property: If the disk is created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param lun the lun value to set. + * @return the ImageDiskReference object itself. + */ + public ImageDiskReference withLun(Integer lun) { + this.lun = lun; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model ImageDiskReference")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageListResult.java new file mode 100644 index 0000000000000..e9e2d4cae788b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.ImageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Image operation response. */ +@Fluent +public final class ImageListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageListResult.class); + + /* + * The list of Images. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Images. Call ListNext() with this to + * fetch the next page of Images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of Images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Images. + * + * @param value the value value to set. + * @return the ImageListResult object itself. + */ + public ImageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Images. Call ListNext() with this to fetch the next + * page of Images. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Images. Call ListNext() with this to fetch the next + * page of Images. + * + * @param nextLink the nextLink value to set. + * @return the ImageListResult object itself. + */ + public ImageListResult 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 ImageListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageOSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageOSDisk.java new file mode 100644 index 0000000000000..cd6c68523a540 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageOSDisk.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an Operating System disk. */ +@Fluent +public final class ImageOSDisk extends ImageDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageOSDisk.class); + + /* + * This property allows you to specify the type of the OS that is included + * in the disk if creating a VM from a custom image.

    Possible + * values are:

    **Windows**

    **Linux** + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /* + * The OS State. + */ + @JsonProperty(value = "osState", required = true) + private OperatingSystemStateTypes osState; + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** + * <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the ImageOSDisk object itself. + */ + public ImageOSDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the osState property: The OS State. + * + * @return the osState value. + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the osState property: The OS State. + * + * @param osState the osState value to set. + * @return the ImageOSDisk object itself. + */ + public ImageOSDisk withOsState(OperatingSystemStateTypes osState) { + this.osState = osState; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withSnapshot(SubResource snapshot) { + super.withSnapshot(snapshot); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withManagedDisk(SubResource managedDisk) { + super.withManagedDisk(managedDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withBlobUri(String blobUri) { + super.withBlobUri(blobUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withCaching(CachingTypes caching) { + super.withCaching(caching); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withDiskSizeGB(Integer diskSizeGB) { + super.withDiskSizeGB(diskSizeGB); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withStorageAccountType(StorageAccountTypes storageAccountType) { + super.withStorageAccountType(storageAccountType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageOSDisk withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + super.withDiskEncryptionSet(diskEncryptionSet); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (osType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model ImageOSDisk")); + } + if (osState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property osState in model ImageOSDisk")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImagePurchasePlan.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImagePurchasePlan.java new file mode 100644 index 0000000000000..0d1d8d58d7de0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImagePurchasePlan.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the gallery image definition purchase plan. This is used by marketplace images. */ +@Fluent +public final class ImagePurchasePlan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImagePurchasePlan.class); + + /* + * The plan ID. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The product ID. + */ + @JsonProperty(value = "product") + private String product; + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The product ID. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The product ID. + * + * @param product the product value to set. + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageReference.java new file mode 100644 index 0000000000000..56ee575a62143 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageReference.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the image to use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can + * only be set when you create the scale set. + */ +@Fluent +public final class ImageReference extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageReference.class); + + /* + * The image publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + */ + @JsonProperty(value = "offer") + private String offer; + + /* + * The image SKU. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' + * to use the latest version of an image available at deploy time. Even if + * you use 'latest', the VM image will not automatically update after + * deploy time even if a new version becomes available. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Specifies in decimal numbers, the version of platform image or + * marketplace image used to create the virtual machine. This readonly + * field differs from 'version', only if the value specified in 'version' + * field is 'latest'. + */ + @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) + private String exactVersion; + + /** + * Get the publisher property: The image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The image publisher. + * + * @param publisher the publisher value to set. + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @param offer the offer value to set. + * @return the ImageReference object itself. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The image SKU. + * + * @param sku the sku value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * + * @param version the version value to set. + * @return the ImageReference object itself. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the exactVersion property: Specifies in decimal numbers, the version of platform image or marketplace image + * used to create the virtual machine. This readonly field differs from 'version', only if the value specified in + * 'version' field is 'latest'. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** {@inheritDoc} */ + @Override + public ImageReference withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java new file mode 100644 index 0000000000000..bd59414d7cc68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageStorageProfile.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a storage profile. */ +@Fluent +public final class ImageStorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageStorageProfile.class); + + /* + * Specifies information about the operating system disk used by the + * virtual machine.

    For more information about disks, see [About + * disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private ImageOSDisk osDisk; + + /* + * Specifies the parameters that are used to add a data disk to a virtual + * machine.

    For more information about disks, see [About disks and + * VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * Specifies whether an image is zone resilient or not. Default is false. + * Zone resilient images can be created only in regions that provide Zone + * Redundant Storage (ZRS). + */ + @JsonProperty(value = "zoneResilient") + private Boolean zoneResilient; + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public ImageOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withOsDisk(ImageOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone + * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @return the zoneResilient value. + */ + public Boolean zoneResilient() { + return this.zoneResilient; + } + + /** + * Set the zoneResilient property: Specifies whether an image is zone resilient or not. Default is false. Zone + * resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param zoneResilient the zoneResilient value to set. + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withZoneResilient(Boolean zoneResilient) { + this.zoneResilient = zoneResilient; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java new file mode 100644 index 0000000000000..7687cec1ad530 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The source user image virtual hard disk. Only tags may be updated. */ +@JsonFlatten +@Fluent +public class ImageUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdate.class); + + /* + * The source virtual machine from which Image is created. + */ + @JsonProperty(value = "properties.sourceVirtualMachine") + private SubResource sourceVirtualMachine; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private ImageStorageProfile storageProfile; + + /* + * The provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Specifies the HyperVGenerationType of the VirtualMachine created from + * the image. From API Version 2019-03-01 if the image source is a blob, + * then we need the user to specify the value, if the source is managed + * resource like disk or snapshot, we may require the user to specify the + * property if we cannot deduce it from the source managed resource. + */ + @JsonProperty(value = "properties.hyperVGeneration") + private HyperVGenerationTypes hyperVGeneration; + + /** + * Get the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value. + */ + public SubResource sourceVirtualMachine() { + return this.sourceVirtualMachine; + } + + /** + * Set the sourceVirtualMachine property: The source virtual machine from which Image is created. + * + * @param sourceVirtualMachine the sourceVirtualMachine value to set. + * @return the ImageUpdate object itself. + */ + public ImageUpdate withSourceVirtualMachine(SubResource sourceVirtualMachine) { + this.sourceVirtualMachine = sourceVirtualMachine; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public ImageStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the ImageUpdate object itself. + */ + public ImageUpdate withStorageProfile(ImageStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Specifies the HyperVGenerationType of the VirtualMachine created from the + * image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if + * the source is managed resource like disk or snapshot, we may require the user to specify the property if we + * cannot deduce it from the source managed resource. + * + * @param hyperVGeneration the hyperVGeneration value to set. + * @return the ImageUpdate object itself. + */ + public ImageUpdate withHyperVGeneration(HyperVGenerationTypes hyperVGeneration) { + this.hyperVGeneration = hyperVGeneration; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (storageProfile() != null) { + storageProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java new file mode 100644 index 0000000000000..c13104b1a0b9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Images.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 Images. */ +public interface Images { + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String imageName); + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 imageName, Context context); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + Image getByResourceGroup(String resourceGroupName, String imageName); + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String imageName, String expand, Context context); + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of images under 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 the list of images under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + PagedIterable list(); + + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + PagedIterable list(Context context); + + /** + * Gets an image. + * + * @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 an image. + */ + Image getById(String id); + + /** + * Gets an image. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Deletes an Image. + * + * @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 an Image. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Image resource. + * + * @param name resource name. + * @return the first stage of the new Image definition. + */ + Image.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InnerError.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InnerError.java new file mode 100644 index 0000000000000..43b775993a159 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InnerError.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inner error details. */ +@Fluent +public final class InnerError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InnerError.class); + + /* + * The exception type. + */ + @JsonProperty(value = "exceptiontype") + private String exceptiontype; + + /* + * The internal error message or exception dump. + */ + @JsonProperty(value = "errordetail") + private String errordetail; + + /** + * Get the exceptiontype property: The exception type. + * + * @return the exceptiontype value. + */ + public String exceptiontype() { + return this.exceptiontype; + } + + /** + * Set the exceptiontype property: The exception type. + * + * @param exceptiontype the exceptiontype value to set. + * @return the InnerError object itself. + */ + public InnerError withExceptiontype(String exceptiontype) { + this.exceptiontype = exceptiontype; + return this; + } + + /** + * Get the errordetail property: The internal error message or exception dump. + * + * @return the errordetail value. + */ + public String errordetail() { + return this.errordetail; + } + + /** + * Set the errordetail property: The internal error message or exception dump. + * + * @param errordetail the errordetail value to set. + * @return the InnerError object itself. + */ + public InnerError withErrordetail(String errordetail) { + this.errordetail = errordetail; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.java new file mode 100644 index 0000000000000..638ff3a2d29e5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceSku.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InstanceSku model. */ +@Immutable +public final class InstanceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstanceSku.class); + + /* + * The sku name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The tier of the cloud service role instance. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The tier of the cloud service role instance. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java new file mode 100644 index 0000000000000..07954d8f6a982 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatus.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class InstanceViewStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstanceViewStatus.class); + + /* + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time") + private OffsetDateTime time; + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The status code. + * + * @param code the code value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the displayStatus property: The short localizable label for the status. + * + * @param displayStatus the displayStatus value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The detailed status message, including for alerts and error messages. + * + * @param message the message value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time of the status. + * + * @param time the time value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java new file mode 100644 index 0000000000000..6cf8f4da46d84 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewStatusesSummary.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Instance view statuses. */ +@Immutable +public final class InstanceViewStatusesSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstanceViewStatusesSummary.class); + + /* + * The statusesSummary property. + */ + @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) + private List statusesSummary; + + /** + * Get the statusesSummary property: The statusesSummary property. + * + * @return the statusesSummary value. + */ + public List statusesSummary() { + return this.statusesSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusesSummary() != null) { + statusesSummary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java new file mode 100644 index 0000000000000..01344b9ee52c6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for InstanceViewTypes. */ +public enum InstanceViewTypes { + /** Enum value instanceView. */ + INSTANCE_VIEW("instanceView"), + + /** Enum value userData. */ + USER_DATA("userData"); + + /** The actual serialized value for a InstanceViewTypes instance. */ + private final String value; + + InstanceViewTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InstanceViewTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed InstanceViewTypes object, or null if unable to parse. + */ + @JsonCreator + public static InstanceViewTypes fromString(String value) { + InstanceViewTypes[] items = InstanceViewTypes.values(); + for (InstanceViewTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.java new file mode 100644 index 0000000000000..12175e15b6ac7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IntervalInMins.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for IntervalInMins. */ +public enum IntervalInMins { + /** Enum value ThreeMins. */ + THREE_MINS("ThreeMins"), + + /** Enum value FiveMins. */ + FIVE_MINS("FiveMins"), + + /** Enum value ThirtyMins. */ + THIRTY_MINS("ThirtyMins"), + + /** Enum value SixtyMins. */ + SIXTY_MINS("SixtyMins"); + + /** The actual serialized value for a IntervalInMins instance. */ + private final String value; + + IntervalInMins(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IntervalInMins instance. + * + * @param value the serialized value to parse. + * @return the parsed IntervalInMins object, or null if unable to parse. + */ + @JsonCreator + public static IntervalInMins fromString(String value) { + IntervalInMins[] items = IntervalInMins.values(); + for (IntervalInMins item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.java new file mode 100644 index 0000000000000..2f987208d2812 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpVersion. */ +public final class IpVersion extends ExpandableStringEnum { + /** Static value IPv4 for IpVersion. */ + public static final IpVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpVersion. */ + public static final IpVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** @return known IpVersion values. */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java new file mode 100644 index 0000000000000..97520e67502bb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/IpVersions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpVersions. */ +public final class IpVersions extends ExpandableStringEnum { + /** Static value IPv4 for IpVersions. */ + public static final IpVersions IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpVersions. */ + public static final IpVersions IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IpVersions from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersions. + */ + @JsonCreator + public static IpVersions fromString(String name) { + return fromString(name, IpVersions.class); + } + + /** @return known IpVersions values. */ + public static Collection values() { + return values(IpVersions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java new file mode 100644 index 0000000000000..23c7246a18000 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. */ +@Fluent +public final class KeyForDiskEncryptionSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyForDiskEncryptionSet.class); + + /* + * Resource id of the KeyVault containing the key or secret. This property + * is optional and cannot be used if the KeyVault subscription is not the + * same as the Disk Encryption Set subscription. + */ + @JsonProperty(value = "sourceVault") + private SourceVault sourceVault; + + /* + * Fully versioned Key Url pointing to a key in KeyVault. Version segment + * of the Url is required regardless of rotationToLatestKeyVersionEnabled + * value. + */ + @JsonProperty(value = "keyUrl", required = true) + private String keyUrl; + + /** + * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. This property is optional + * and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. + * + * @return the sourceVault value. + */ + public SourceVault sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. This property is optional + * and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyForDiskEncryptionSet object itself. + */ + public KeyForDiskEncryptionSet withSourceVault(SourceVault sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the keyUrl property: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is + * required regardless of rotationToLatestKeyVersionEnabled value. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is + * required regardless of rotationToLatestKeyVersionEnabled value. + * + * @param keyUrl the keyUrl value to set. + * @return the KeyForDiskEncryptionSet object itself. + */ + public KeyForDiskEncryptionSet withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() != null) { + sourceVault().validate(); + } + if (keyUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyUrl in model KeyForDiskEncryptionSet")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.java new file mode 100644 index 0000000000000..a2c378fbe42be --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndKeyReference.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. */ +@Fluent +public final class KeyVaultAndKeyReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultAndKeyReference.class); + + /* + * Resource id of the KeyVault containing the key or secret + */ + @JsonProperty(value = "sourceVault", required = true) + private SourceVault sourceVault; + + /* + * Url pointing to a key or secret in KeyVault + */ + @JsonProperty(value = "keyUrl", required = true) + private String keyUrl; + + /** + * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. + * + * @return the sourceVault value. + */ + public SourceVault sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyVaultAndKeyReference object itself. + */ + public KeyVaultAndKeyReference withSourceVault(SourceVault sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the keyUrl property: Url pointing to a key or secret in KeyVault. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Url pointing to a key or secret in KeyVault. + * + * @param keyUrl the keyUrl value to set. + * @return the KeyVaultAndKeyReference object itself. + */ + public KeyVaultAndKeyReference withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceVault in model KeyVaultAndKeyReference")); + } else { + sourceVault().validate(); + } + if (keyUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyUrl in model KeyVaultAndKeyReference")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java new file mode 100644 index 0000000000000..b0748bcd1562b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultAndSecretReference.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault Secret Url and vault id of the encryption key. */ +@Fluent +public final class KeyVaultAndSecretReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultAndSecretReference.class); + + /* + * Resource id of the KeyVault containing the key or secret + */ + @JsonProperty(value = "sourceVault", required = true) + private SourceVault sourceVault; + + /* + * Url pointing to a key or secret in KeyVault + */ + @JsonProperty(value = "secretUrl", required = true) + private String secretUrl; + + /** + * Get the sourceVault property: Resource id of the KeyVault containing the key or secret. + * + * @return the sourceVault value. + */ + public SourceVault sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: Resource id of the KeyVault containing the key or secret. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyVaultAndSecretReference object itself. + */ + public KeyVaultAndSecretReference withSourceVault(SourceVault sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the secretUrl property: Url pointing to a key or secret in KeyVault. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: Url pointing to a key or secret in KeyVault. + * + * @param secretUrl the secretUrl value to set. + * @return the KeyVaultAndSecretReference object itself. + */ + public KeyVaultAndSecretReference withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceVault in model KeyVaultAndSecretReference")); + } else { + sourceVault().validate(); + } + if (secretUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretUrl in model KeyVaultAndSecretReference")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.java new file mode 100644 index 0000000000000..37bcfb38d0847 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultKeyReference.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to Key Vault Key. */ +@Fluent +public final class KeyVaultKeyReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultKeyReference.class); + + /* + * The URL referencing a key encryption key in Key Vault. + */ + @JsonProperty(value = "keyUrl", required = true) + private String keyUrl; + + /* + * The relative URL of the Key Vault containing the key. + */ + @JsonProperty(value = "sourceVault", required = true) + private SubResource sourceVault; + + /** + * Get the keyUrl property: The URL referencing a key encryption key in Key Vault. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: The URL referencing a key encryption key in Key Vault. + * + * @param keyUrl the keyUrl value to set. + * @return the KeyVaultKeyReference object itself. + */ + public KeyVaultKeyReference withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing the key. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing the key. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyVaultKeyReference object itself. + */ + public KeyVaultKeyReference withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyUrl in model KeyVaultKeyReference")); + } + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceVault in model KeyVaultKeyReference")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.java new file mode 100644 index 0000000000000..6ffd54005b5e6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyVaultSecretReference.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a reference to Key Vault Secret. */ +@Fluent +public final class KeyVaultSecretReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultSecretReference.class); + + /* + * The URL referencing a secret in a Key Vault. + */ + @JsonProperty(value = "secretUrl", required = true) + private String secretUrl; + + /* + * The relative URL of the Key Vault containing the secret. + */ + @JsonProperty(value = "sourceVault", required = true) + private SubResource sourceVault; + + /** + * Get the secretUrl property: The URL referencing a secret in a Key Vault. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: The URL referencing a secret in a Key Vault. + * + * @param secretUrl the secretUrl value to set. + * @return the KeyVaultSecretReference object itself. + */ + public KeyVaultSecretReference withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing the secret. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing the secret. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyVaultSecretReference object itself. + */ + public KeyVaultSecretReference withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property secretUrl in model KeyVaultSecretReference")); + } + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceVault in model KeyVaultSecretReference")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.java new file mode 100644 index 0000000000000..913b5dfd3b540 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LastPatchInstallationSummary.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of the last installed patch summary. */ +@Immutable +public final class LastPatchInstallationSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LastPatchInstallationSummary.class); + + /* + * The overall success or failure status of the operation. It remains + * "InProgress" until the operation completes. At that point it will become + * "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PatchOperationStatus status; + + /* + * The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + */ + @JsonProperty(value = "installationActivityId", access = JsonProperty.Access.WRITE_ONLY) + private String installationActivityId; + + /* + * Describes whether the operation ran out of time before it completed all + * its intended actions + */ + @JsonProperty(value = "maintenanceWindowExceeded", access = JsonProperty.Access.WRITE_ONLY) + private Boolean maintenanceWindowExceeded; + + /* + * The number of all available patches but not going to be installed + * because it didn't match a classification or inclusion list entry. + */ + @JsonProperty(value = "notSelectedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer notSelectedPatchCount; + + /* + * The number of all available patches but excluded explicitly by a + * customer-specified exclusion list match. + */ + @JsonProperty(value = "excludedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer excludedPatchCount; + + /* + * The number of all available patches expected to be installed over the + * course of the patch installation operation. + */ + @JsonProperty(value = "pendingPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer pendingPatchCount; + + /* + * The count of patches that successfully installed. + */ + @JsonProperty(value = "installedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer installedPatchCount; + + /* + * The count of patches that failed installation. + */ + @JsonProperty(value = "failedPatchCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedPatchCount; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The UTC timestamp when the operation began. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The errors that were encountered during execution of the operation. The + * details array contains the list of them. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + public PatchOperationStatus status() { + return this.status; + } + + /** + * Get the installationActivityId property: The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + * + * @return the installationActivityId value. + */ + public String installationActivityId() { + return this.installationActivityId; + } + + /** + * Get the maintenanceWindowExceeded property: Describes whether the operation ran out of time before it completed + * all its intended actions. + * + * @return the maintenanceWindowExceeded value. + */ + public Boolean maintenanceWindowExceeded() { + return this.maintenanceWindowExceeded; + } + + /** + * Get the notSelectedPatchCount property: The number of all available patches but not going to be installed because + * it didn't match a classification or inclusion list entry. + * + * @return the notSelectedPatchCount value. + */ + public Integer notSelectedPatchCount() { + return this.notSelectedPatchCount; + } + + /** + * Get the excludedPatchCount property: The number of all available patches but excluded explicitly by a + * customer-specified exclusion list match. + * + * @return the excludedPatchCount value. + */ + public Integer excludedPatchCount() { + return this.excludedPatchCount; + } + + /** + * Get the pendingPatchCount property: The number of all available patches expected to be installed over the course + * of the patch installation operation. + * + * @return the pendingPatchCount value. + */ + public Integer pendingPatchCount() { + return this.pendingPatchCount; + } + + /** + * Get the installedPatchCount property: The count of patches that successfully installed. + * + * @return the installedPatchCount value. + */ + public Integer installedPatchCount() { + return this.installedPatchCount; + } + + /** + * Get the failedPatchCount property: The count of patches that failed installation. + * + * @return the failedPatchCount value. + */ + public Integer failedPatchCount() { + return this.failedPatchCount; + } + + /** + * Get the startTime property: The UTC timestamp when the operation began. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the lastModifiedTime property: The UTC timestamp when the operation began. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java new file mode 100644 index 0000000000000..48a92f702a359 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported + * Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ +@Fluent +public final class LinuxConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxConfiguration.class); + + /* + * Specifies whether password authentication should be disabled. + */ + @JsonProperty(value = "disablePasswordAuthentication") + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /* + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on + * Linux. + */ + @JsonProperty(value = "patchSettings") + private LinuxPatchSettings patchSettings; + + /** + * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * Get the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @param ssh the ssh value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. <br><br> When this property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM + * later. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. <br><br> When this property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM + * later. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + * + * @return the patchSettings value. + */ + public LinuxPatchSettings patchSettings() { + return this.patchSettings; + } + + /** + * Set the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + * + * @param patchSettings the patchSettings value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withPatchSettings(LinuxPatchSettings patchSettings) { + this.patchSettings = patchSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + if (patchSettings() != null) { + patchSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.java new file mode 100644 index 0000000000000..025ec2540e3c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxParameters.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for InstallPatches on a Linux VM, as directly received by the API. */ +@Fluent +public final class LinuxParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxParameters.class); + + /* + * The update classifications to select when installing patches for Linux. + */ + @JsonProperty(value = "classificationsToInclude") + private List classificationsToInclude; + + /* + * packages to include in the patch operation. Format: + * packageName_packageVersion + */ + @JsonProperty(value = "packageNameMasksToInclude") + private List packageNameMasksToInclude; + + /* + * packages to exclude in the patch operation. Format: + * packageName_packageVersion + */ + @JsonProperty(value = "packageNameMasksToExclude") + private List packageNameMasksToExclude; + + /* + * This is used as a maintenance run identifier for Auto VM Guest Patching + * in Linux. + */ + @JsonProperty(value = "maintenanceRunId") + private String maintenanceRunId; + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Linux. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToInclude value. + */ + public List packageNameMasksToInclude() { + return this.packageNameMasksToInclude; + } + + /** + * Set the packageNameMasksToInclude property: packages to include in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToInclude the packageNameMasksToInclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToInclude(List packageNameMasksToInclude) { + this.packageNameMasksToInclude = packageNameMasksToInclude; + return this; + } + + /** + * Get the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @return the packageNameMasksToExclude value. + */ + public List packageNameMasksToExclude() { + return this.packageNameMasksToExclude; + } + + /** + * Set the packageNameMasksToExclude property: packages to exclude in the patch operation. Format: + * packageName_packageVersion. + * + * @param packageNameMasksToExclude the packageNameMasksToExclude value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withPackageNameMasksToExclude(List packageNameMasksToExclude) { + this.packageNameMasksToExclude = packageNameMasksToExclude; + return this; + } + + /** + * Get the maintenanceRunId property: This is used as a maintenance run identifier for Auto VM Guest Patching in + * Linux. + * + * @return the maintenanceRunId value. + */ + public String maintenanceRunId() { + return this.maintenanceRunId; + } + + /** + * Set the maintenanceRunId property: This is used as a maintenance run identifier for Auto VM Guest Patching in + * Linux. + * + * @param maintenanceRunId the maintenanceRunId value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withMaintenanceRunId(String maintenanceRunId) { + this.maintenanceRunId = maintenanceRunId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java new file mode 100644 index 0000000000000..70de3754112cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchAssessmentMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinuxPatchAssessmentMode. */ +public final class LinuxPatchAssessmentMode extends ExpandableStringEnum { + /** Static value ImageDefault for LinuxPatchAssessmentMode. */ + public static final LinuxPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for LinuxPatchAssessmentMode. */ + public static final LinuxPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates or finds a LinuxPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxPatchAssessmentMode. + */ + @JsonCreator + public static LinuxPatchAssessmentMode fromString(String name) { + return fromString(name, LinuxPatchAssessmentMode.class); + } + + /** @return known LinuxPatchAssessmentMode values. */ + public static Collection values() { + return values(LinuxPatchAssessmentMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java new file mode 100644 index 0000000000000..0aa3139acdb34 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies settings related to VM Guest Patching on Linux. */ +@Fluent +public final class LinuxPatchSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxPatchSettings.class); + + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or + * virtual machines associated to virtual machine scale set with + * OrchestrationMode as Flexible.

    Possible values are:

    **ImageDefault** - The virtual machine's default patching + * configuration is used.

    **AutomaticByPlatform** - The + * virtual machine will be automatically updated by the platform. The + * property provisionVMAgent must be true + */ + @JsonProperty(value = "patchMode") + private LinuxVMGuestPatchMode patchMode; + + /* + * Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.

    Possible values are:

    **ImageDefault** - + * You control the timing of patch assessments on a virtual machine.

    **AutomaticByPlatform** - The platform will trigger periodic + * patch assessments. The property provisionVMAgent must be true. + */ + @JsonProperty(value = "assessmentMode") + private LinuxPatchAssessmentMode assessmentMode; + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @return the patchMode value. + */ + public LinuxVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @param patchMode the patchMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withPatchMode(LinuxVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public LinuxPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withAssessmentMode(LinuxPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.java new file mode 100644 index 0000000000000..3c29c272ba9e8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxVMGuestPatchMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LinuxVMGuestPatchMode. */ +public final class LinuxVMGuestPatchMode extends ExpandableStringEnum { + /** Static value ImageDefault for LinuxVMGuestPatchMode. */ + public static final LinuxVMGuestPatchMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for LinuxVMGuestPatchMode. */ + public static final LinuxVMGuestPatchMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates or finds a LinuxVMGuestPatchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxVMGuestPatchMode. + */ + @JsonCreator + public static LinuxVMGuestPatchMode fromString(String name) { + return fromString(name, LinuxVMGuestPatchMode.class); + } + + /** @return known LinuxVMGuestPatchMode values. */ + public static Collection values() { + return values(LinuxVMGuestPatchMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.java new file mode 100644 index 0000000000000..b78f2b6d40edb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ListUsagesResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Usages operation response. */ +@Fluent +public final class ListUsagesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListUsagesResult.class); + + /* + * The list of compute resource usages. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of compute resource usage information. + * Call ListNext() with this to fetch the next page of compute resource + * usage information. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of compute resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of compute resource usages. + * + * @param value the value value to set. + * @return the ListUsagesResult object itself. + */ + public ListUsagesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() + * with this to fetch the next page of compute resource usage information. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() + * with this to fetch the next page of compute resource usage information. + * + * @param nextLink the nextLink value to set. + * @return the ListUsagesResult object itself. + */ + public ListUsagesResult 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 ListUsagesResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java new file mode 100644 index 0000000000000..3f8b1f9870319 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfiguration.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the load balancer configuration. */ +@Fluent +public final class LoadBalancerConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerConfiguration.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the Load balancer + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the load balancer configuration. + */ + @JsonProperty(value = "properties", required = true) + private LoadBalancerConfigurationProperties properties; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id. + * + * @param id the id value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the Load balancer. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Load balancer. + * + * @param name the name value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of the load balancer configuration. + * + * @return the properties value. + */ + public LoadBalancerConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the load balancer configuration. + * + * @param properties the properties value to set. + * @return the LoadBalancerConfiguration object itself. + */ + public LoadBalancerConfiguration withProperties(LoadBalancerConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model LoadBalancerConfiguration")); + } + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model LoadBalancerConfiguration")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java new file mode 100644 index 0000000000000..ddcb457755cdd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerConfigurationProperties.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LoadBalancerConfigurationProperties model. */ +@Fluent +public final class LoadBalancerConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerConfigurationProperties.class); + + /* + * Specifies the frontend IP to be used for the load balancer. Only IPv4 + * frontend IP address is supported. Each load balancer configuration must + * have exactly one frontend IP configuration. + */ + @JsonProperty(value = "frontendIPConfigurations", required = true) + private List frontendIpConfigurations; + + /** + * Get the frontendIpConfigurations property: Specifies the frontend IP to be used for the load balancer. Only IPv4 + * frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP + * configuration. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: Specifies the frontend IP to be used for the load balancer. Only IPv4 + * frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP + * configuration. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerConfigurationProperties object itself. + */ + public LoadBalancerConfigurationProperties withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontendIpConfigurations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property frontendIpConfigurations in model" + + " LoadBalancerConfigurationProperties")); + } else { + frontendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.java new file mode 100644 index 0000000000000..b19a2704f0c68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfiguration.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LoadBalancerFrontendIpConfiguration model. */ +@Fluent +public final class LoadBalancerFrontendIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfiguration.class); + + /* + * The name of the resource that is unique within the set of frontend IP + * configurations used by the load balancer. This name can be used to + * access the resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of load balancer frontend ip configuration. + */ + @JsonProperty(value = "properties", required = true) + private LoadBalancerFrontendIpConfigurationProperties properties; + + /** + * Get the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within the set of frontend IP configurations used + * by the load balancer. This name can be used to access the resource. + * + * @param name the name value to set. + * @return the LoadBalancerFrontendIpConfiguration object itself. + */ + public LoadBalancerFrontendIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of load balancer frontend ip configuration. + * + * @return the properties value. + */ + public LoadBalancerFrontendIpConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of load balancer frontend ip configuration. + * + * @param properties the properties value to set. + * @return the LoadBalancerFrontendIpConfiguration object itself. + */ + public LoadBalancerFrontendIpConfiguration withProperties( + LoadBalancerFrontendIpConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model LoadBalancerFrontendIpConfiguration")); + } + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model LoadBalancerFrontendIpConfiguration")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java new file mode 100644 index 0000000000000..2492d4233bdcd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LoadBalancerFrontendIpConfigurationProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a cloud service IP Configuration. */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationProperties.class); + + /* + * The reference to the public ip address resource. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /* + * The reference to the virtual network subnet resource. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The virtual network private IP address of the IP configuration. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /** + * Get the publicIpAddress property: The reference to the public ip address resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The reference to the public ip address resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the subnet property: The reference to the virtual network subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The reference to the virtual network subnet resource. + * + * @param subnet the subnet value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the privateIpAddress property: The virtual network private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The virtual network private IP address of the IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LoadBalancerFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerFrontendIpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.java new file mode 100644 index 0000000000000..cf4d5fb9001dc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalytics.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.compute.generated.models; + +import com.azure.core.util.Context; + +/** Resource collection API of LogAnalytics. */ +public interface LogAnalytics { + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + LogAnalyticsOperationResult exportRequestRateByInterval(String location, RequestRateByIntervalInput parameters); + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + LogAnalyticsOperationResult exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + LogAnalyticsOperationResult exportThrottledRequests(String location, ThrottledRequestsInput parameters); + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logAnalytics operation status response. + */ + LogAnalyticsOperationResult exportThrottledRequests( + String location, ThrottledRequestsInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java new file mode 100644 index 0000000000000..d7655d611749e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsInputBase.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Api input base class for LogAnalytics Api. */ +@Fluent +public class LogAnalyticsInputBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsInputBase.class); + + /* + * SAS Uri of the logging blob container to which LogAnalytics Api writes + * output logs to. + */ + @JsonProperty(value = "blobContainerSasUri", required = true) + private String blobContainerSasUri; + + /* + * From time of the query + */ + @JsonProperty(value = "fromTime", required = true) + private OffsetDateTime fromTime; + + /* + * To time of the query + */ + @JsonProperty(value = "toTime", required = true) + private OffsetDateTime toTime; + + /* + * Group query result by Throttle Policy applied. + */ + @JsonProperty(value = "groupByThrottlePolicy") + private Boolean groupByThrottlePolicy; + + /* + * Group query result by Operation Name. + */ + @JsonProperty(value = "groupByOperationName") + private Boolean groupByOperationName; + + /* + * Group query result by Resource Name. + */ + @JsonProperty(value = "groupByResourceName") + private Boolean groupByResourceName; + + /* + * Group query result by Client Application ID. + */ + @JsonProperty(value = "groupByClientApplicationId") + private Boolean groupByClientApplicationId; + + /* + * Group query result by User Agent. + */ + @JsonProperty(value = "groupByUserAgent") + private Boolean groupByUserAgent; + + /** + * Get the blobContainerSasUri property: SAS Uri of the logging blob container to which LogAnalytics Api writes + * output logs to. + * + * @return the blobContainerSasUri value. + */ + public String blobContainerSasUri() { + return this.blobContainerSasUri; + } + + /** + * Set the blobContainerSasUri property: SAS Uri of the logging blob container to which LogAnalytics Api writes + * output logs to. + * + * @param blobContainerSasUri the blobContainerSasUri value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withBlobContainerSasUri(String blobContainerSasUri) { + this.blobContainerSasUri = blobContainerSasUri; + return this; + } + + /** + * Get the fromTime property: From time of the query. + * + * @return the fromTime value. + */ + public OffsetDateTime fromTime() { + return this.fromTime; + } + + /** + * Set the fromTime property: From time of the query. + * + * @param fromTime the fromTime value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withFromTime(OffsetDateTime fromTime) { + this.fromTime = fromTime; + return this; + } + + /** + * Get the toTime property: To time of the query. + * + * @return the toTime value. + */ + public OffsetDateTime toTime() { + return this.toTime; + } + + /** + * Set the toTime property: To time of the query. + * + * @param toTime the toTime value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withToTime(OffsetDateTime toTime) { + this.toTime = toTime; + return this; + } + + /** + * Get the groupByThrottlePolicy property: Group query result by Throttle Policy applied. + * + * @return the groupByThrottlePolicy value. + */ + public Boolean groupByThrottlePolicy() { + return this.groupByThrottlePolicy; + } + + /** + * Set the groupByThrottlePolicy property: Group query result by Throttle Policy applied. + * + * @param groupByThrottlePolicy the groupByThrottlePolicy value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { + this.groupByThrottlePolicy = groupByThrottlePolicy; + return this; + } + + /** + * Get the groupByOperationName property: Group query result by Operation Name. + * + * @return the groupByOperationName value. + */ + public Boolean groupByOperationName() { + return this.groupByOperationName; + } + + /** + * Set the groupByOperationName property: Group query result by Operation Name. + * + * @param groupByOperationName the groupByOperationName value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByOperationName(Boolean groupByOperationName) { + this.groupByOperationName = groupByOperationName; + return this; + } + + /** + * Get the groupByResourceName property: Group query result by Resource Name. + * + * @return the groupByResourceName value. + */ + public Boolean groupByResourceName() { + return this.groupByResourceName; + } + + /** + * Set the groupByResourceName property: Group query result by Resource Name. + * + * @param groupByResourceName the groupByResourceName value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByResourceName(Boolean groupByResourceName) { + this.groupByResourceName = groupByResourceName; + return this; + } + + /** + * Get the groupByClientApplicationId property: Group query result by Client Application ID. + * + * @return the groupByClientApplicationId value. + */ + public Boolean groupByClientApplicationId() { + return this.groupByClientApplicationId; + } + + /** + * Set the groupByClientApplicationId property: Group query result by Client Application ID. + * + * @param groupByClientApplicationId the groupByClientApplicationId value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByClientApplicationId(Boolean groupByClientApplicationId) { + this.groupByClientApplicationId = groupByClientApplicationId; + return this; + } + + /** + * Get the groupByUserAgent property: Group query result by User Agent. + * + * @return the groupByUserAgent value. + */ + public Boolean groupByUserAgent() { + return this.groupByUserAgent; + } + + /** + * Set the groupByUserAgent property: Group query result by User Agent. + * + * @param groupByUserAgent the groupByUserAgent value to set. + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByUserAgent(Boolean groupByUserAgent) { + this.groupByUserAgent = groupByUserAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobContainerSasUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobContainerSasUri in model LogAnalyticsInputBase")); + } + if (fromTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property fromTime in model LogAnalyticsInputBase")); + } + if (toTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property toTime in model LogAnalyticsInputBase")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOperationResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOperationResult.java new file mode 100644 index 0000000000000..dc382d551f861 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOperationResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner; + +/** An immutable client-side representation of LogAnalyticsOperationResult. */ +public interface LogAnalyticsOperationResult { + /** + * Gets the properties property: LogAnalyticsOutput. + * + * @return the properties value. + */ + LogAnalyticsOutput properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.LogAnalyticsOperationResultInner object. + * + * @return the inner object. + */ + LogAnalyticsOperationResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOutput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOutput.java new file mode 100644 index 0000000000000..0f8cc60b4ff5b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LogAnalyticsOutput.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LogAnalytics output properties. */ +@Immutable +public final class LogAnalyticsOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsOutput.class); + + /* + * Output file Uri path to blob container. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private String output; + + /** + * Get the output property: Output file Uri path to blob container. + * + * @return the output value. + */ + public String output() { + return this.output; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.java new file mode 100644 index 0000000000000..ab091c460671a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceOperationResultCodeTypes.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for MaintenanceOperationResultCodeTypes. */ +public enum MaintenanceOperationResultCodeTypes { + /** Enum value None. */ + NONE("None"), + + /** Enum value RetryLater. */ + RETRY_LATER("RetryLater"), + + /** Enum value MaintenanceAborted. */ + MAINTENANCE_ABORTED("MaintenanceAborted"), + + /** Enum value MaintenanceCompleted. */ + MAINTENANCE_COMPLETED("MaintenanceCompleted"); + + /** The actual serialized value for a MaintenanceOperationResultCodeTypes instance. */ + private final String value; + + MaintenanceOperationResultCodeTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MaintenanceOperationResultCodeTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed MaintenanceOperationResultCodeTypes object, or null if unable to parse. + */ + @JsonCreator + public static MaintenanceOperationResultCodeTypes fromString(String value) { + MaintenanceOperationResultCodeTypes[] items = MaintenanceOperationResultCodeTypes.values(); + for (MaintenanceOperationResultCodeTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceRedeployStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceRedeployStatus.java new file mode 100644 index 0000000000000..107a5d84c8ef2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/MaintenanceRedeployStatus.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Maintenance Operation Status. */ +@Fluent +public final class MaintenanceRedeployStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceRedeployStatus.class); + + /* + * True, if customer is allowed to perform Maintenance. + */ + @JsonProperty(value = "isCustomerInitiatedMaintenanceAllowed") + private Boolean isCustomerInitiatedMaintenanceAllowed; + + /* + * Start Time for the Pre Maintenance Window. + */ + @JsonProperty(value = "preMaintenanceWindowStartTime") + private OffsetDateTime preMaintenanceWindowStartTime; + + /* + * End Time for the Pre Maintenance Window. + */ + @JsonProperty(value = "preMaintenanceWindowEndTime") + private OffsetDateTime preMaintenanceWindowEndTime; + + /* + * Start Time for the Maintenance Window. + */ + @JsonProperty(value = "maintenanceWindowStartTime") + private OffsetDateTime maintenanceWindowStartTime; + + /* + * End Time for the Maintenance Window. + */ + @JsonProperty(value = "maintenanceWindowEndTime") + private OffsetDateTime maintenanceWindowEndTime; + + /* + * The Last Maintenance Operation Result Code. + */ + @JsonProperty(value = "lastOperationResultCode") + private MaintenanceOperationResultCodeTypes lastOperationResultCode; + + /* + * Message returned for the last Maintenance Operation. + */ + @JsonProperty(value = "lastOperationMessage") + private String lastOperationMessage; + + /** + * Get the isCustomerInitiatedMaintenanceAllowed property: True, if customer is allowed to perform Maintenance. + * + * @return the isCustomerInitiatedMaintenanceAllowed value. + */ + public Boolean isCustomerInitiatedMaintenanceAllowed() { + return this.isCustomerInitiatedMaintenanceAllowed; + } + + /** + * Set the isCustomerInitiatedMaintenanceAllowed property: True, if customer is allowed to perform Maintenance. + * + * @param isCustomerInitiatedMaintenanceAllowed the isCustomerInitiatedMaintenanceAllowed value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withIsCustomerInitiatedMaintenanceAllowed( + Boolean isCustomerInitiatedMaintenanceAllowed) { + this.isCustomerInitiatedMaintenanceAllowed = isCustomerInitiatedMaintenanceAllowed; + return this; + } + + /** + * Get the preMaintenanceWindowStartTime property: Start Time for the Pre Maintenance Window. + * + * @return the preMaintenanceWindowStartTime value. + */ + public OffsetDateTime preMaintenanceWindowStartTime() { + return this.preMaintenanceWindowStartTime; + } + + /** + * Set the preMaintenanceWindowStartTime property: Start Time for the Pre Maintenance Window. + * + * @param preMaintenanceWindowStartTime the preMaintenanceWindowStartTime value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withPreMaintenanceWindowStartTime(OffsetDateTime preMaintenanceWindowStartTime) { + this.preMaintenanceWindowStartTime = preMaintenanceWindowStartTime; + return this; + } + + /** + * Get the preMaintenanceWindowEndTime property: End Time for the Pre Maintenance Window. + * + * @return the preMaintenanceWindowEndTime value. + */ + public OffsetDateTime preMaintenanceWindowEndTime() { + return this.preMaintenanceWindowEndTime; + } + + /** + * Set the preMaintenanceWindowEndTime property: End Time for the Pre Maintenance Window. + * + * @param preMaintenanceWindowEndTime the preMaintenanceWindowEndTime value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withPreMaintenanceWindowEndTime(OffsetDateTime preMaintenanceWindowEndTime) { + this.preMaintenanceWindowEndTime = preMaintenanceWindowEndTime; + return this; + } + + /** + * Get the maintenanceWindowStartTime property: Start Time for the Maintenance Window. + * + * @return the maintenanceWindowStartTime value. + */ + public OffsetDateTime maintenanceWindowStartTime() { + return this.maintenanceWindowStartTime; + } + + /** + * Set the maintenanceWindowStartTime property: Start Time for the Maintenance Window. + * + * @param maintenanceWindowStartTime the maintenanceWindowStartTime value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withMaintenanceWindowStartTime(OffsetDateTime maintenanceWindowStartTime) { + this.maintenanceWindowStartTime = maintenanceWindowStartTime; + return this; + } + + /** + * Get the maintenanceWindowEndTime property: End Time for the Maintenance Window. + * + * @return the maintenanceWindowEndTime value. + */ + public OffsetDateTime maintenanceWindowEndTime() { + return this.maintenanceWindowEndTime; + } + + /** + * Set the maintenanceWindowEndTime property: End Time for the Maintenance Window. + * + * @param maintenanceWindowEndTime the maintenanceWindowEndTime value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withMaintenanceWindowEndTime(OffsetDateTime maintenanceWindowEndTime) { + this.maintenanceWindowEndTime = maintenanceWindowEndTime; + return this; + } + + /** + * Get the lastOperationResultCode property: The Last Maintenance Operation Result Code. + * + * @return the lastOperationResultCode value. + */ + public MaintenanceOperationResultCodeTypes lastOperationResultCode() { + return this.lastOperationResultCode; + } + + /** + * Set the lastOperationResultCode property: The Last Maintenance Operation Result Code. + * + * @param lastOperationResultCode the lastOperationResultCode value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withLastOperationResultCode( + MaintenanceOperationResultCodeTypes lastOperationResultCode) { + this.lastOperationResultCode = lastOperationResultCode; + return this; + } + + /** + * Get the lastOperationMessage property: Message returned for the last Maintenance Operation. + * + * @return the lastOperationMessage value. + */ + public String lastOperationMessage() { + return this.lastOperationMessage; + } + + /** + * Set the lastOperationMessage property: Message returned for the last Maintenance Operation. + * + * @param lastOperationMessage the lastOperationMessage value to set. + * @return the MaintenanceRedeployStatus object itself. + */ + public MaintenanceRedeployStatus withLastOperationMessage(String lastOperationMessage) { + this.lastOperationMessage = lastOperationMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedArtifact.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedArtifact.java new file mode 100644 index 0000000000000..bb35ac99f930c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedArtifact.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The managed artifact. */ +@Fluent +public final class ManagedArtifact { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedArtifact.class); + + /* + * The managed artifact id. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: The managed artifact id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The managed artifact id. + * + * @param id the id value to set. + * @return the ManagedArtifact object itself. + */ + public ManagedArtifact withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model ManagedArtifact")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java new file mode 100644 index 0000000000000..1809297f5fc08 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ManagedDiskParameters.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters of a managed disk. */ +@Fluent +public final class ManagedDiskParameters extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedDiskParameters.class); + + /* + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the + * managed disk. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /** + * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @return the storageAccountType value. + */ + public StorageAccountTypes storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @param storageAccountType the storageAccountType value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the ManagedDiskParameters object itself. + */ + public ManagedDiskParameters withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedDiskParameters withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.java new file mode 100644 index 0000000000000..791f3b3935990 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkAccessPolicy.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkAccessPolicy. */ +public final class NetworkAccessPolicy extends ExpandableStringEnum { + /** Static value AllowAll for NetworkAccessPolicy. */ + public static final NetworkAccessPolicy ALLOW_ALL = fromString("AllowAll"); + + /** Static value AllowPrivate for NetworkAccessPolicy. */ + public static final NetworkAccessPolicy ALLOW_PRIVATE = fromString("AllowPrivate"); + + /** Static value DenyAll for NetworkAccessPolicy. */ + public static final NetworkAccessPolicy DENY_ALL = fromString("DenyAll"); + + /** + * Creates or finds a NetworkAccessPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkAccessPolicy. + */ + @JsonCreator + public static NetworkAccessPolicy fromString(String name) { + return fromString(name, NetworkAccessPolicy.class); + } + + /** @return known NetworkAccessPolicy values. */ + public static Collection values() { + return values(NetworkAccessPolicy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java new file mode 100644 index 0000000000000..4a1a236fde33c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkApiVersion.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkApiVersion. */ +public final class NetworkApiVersion extends ExpandableStringEnum { + /** Static value 2020-11-01 for NetworkApiVersion. */ + public static final NetworkApiVersion TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE = fromString("2020-11-01"); + + /** + * Creates or finds a NetworkApiVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkApiVersion. + */ + @JsonCreator + public static NetworkApiVersion fromString(String name) { + return fromString(name, NetworkApiVersion.class); + } + + /** @return known NetworkApiVersion values. */ + public static Collection values() { + return values(NetworkApiVersion.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java new file mode 100644 index 0000000000000..5ffef43ce0508 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a network interface reference. */ +@JsonFlatten +@Fluent +public class NetworkInterfaceReference extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceReference.class); + + /* + * Specifies the primary network interface in case the virtual machine has + * more than 1 network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the NetworkInterfaceReference object itself. + */ + public NetworkInterfaceReference withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the NetworkInterfaceReference object itself. + */ + public NetworkInterfaceReference withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceReference withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.java new file mode 100644 index 0000000000000..8eeb7ab36bd63 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the network interfaces or the networking configuration of the virtual machine. */ +@Fluent +public final class NetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); + + /* + * Specifies the list of resource Ids for the network interfaces associated + * with the virtual machine. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /* + * specifies the Microsoft.Network API version used when creating + * networking resources in the Network Interface Configurations + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /* + * Specifies the networking configurations that will be used to create the + * virtual machine networking resources. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /** + * Get the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the virtual machine. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the virtual machine. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: Specifies the networking configurations that will be used to + * create the virtual machine networking resources. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: Specifies the networking configurations that will be used to + * create the virtual machine networking resources. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + 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()); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java new file mode 100644 index 0000000000000..5544175ff95b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the operating system disk used by the virtual machine. <br><br> For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ +@Fluent +public final class OSDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDisk.class); + + /* + * This property allows you to specify the type of the OS that is included + * in the disk if creating a VM from user-image or a specialized VHD. + *

    Possible values are:

    **Windows**

    **Linux** + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + */ + @JsonProperty(value = "encryptionSettings") + private DiskEncryptionSettings encryptionSettings; + + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The virtual hard disk. + */ + @JsonProperty(value = "vhd") + private VirtualHardDisk vhd; + + /* + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + */ + @JsonProperty(value = "image") + private VirtualHardDisk image; + + /* + * Specifies the caching requirements.

    Possible values are: + *

    **None**

    **ReadOnly**

    **ReadWrite**

    + * Default: **None** for Standard storage. **ReadOnly** for Premium + * storage. + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * Specifies the ephemeral Disk Settings for the operating system disk used + * by the virtual machine. + */ + @JsonProperty(value = "diffDiskSettings") + private DiffDiskSettings diffDiskSettings; + + /* + * Specifies how the virtual machine should be created.

    Possible + * values are:

    **Attach** \u2013 This value is used when you are + * using a specialized disk to create the virtual machine.

    + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also + * use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can + * be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Specifies whether OS Disk should be deleted or detached upon VM + * deletion.

    Possible values:

    **Delete** If this value is + * used, the OS disk is deleted when VM is deleted.

    **Detach** If + * this value is used, the os disk is retained after VM is deleted. + *

    The default value is set to **detach**. For an ephemeral OS + * Disk, the default value is set to **Delete**. User cannot change the + * delete option for ephemeral OS Disk. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the OSDisk object itself. + */ + public OSDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the encryptionSettings value. + */ + public DiskEncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set the encryptionSettings property: Specifies the encryption settings for the OS Disk. <br><br> + * Minimum api-version: 2015-06-15. + * + * @param encryptionSettings the encryptionSettings value to set. + * @return the OSDisk object itself. + */ + public OSDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the OSDisk object itself. + */ + public OSDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the vhd property: The virtual hard disk. + * + * @return the vhd value. + */ + public VirtualHardDisk vhd() { + return this.vhd; + } + + /** + * Set the vhd property: The virtual hard disk. + * + * @param vhd the vhd value to set. + * @return the OSDisk object itself. + */ + public OSDisk withVhd(VirtualHardDisk vhd) { + this.vhd = vhd; + return this; + } + + /** + * Get the image property: The source user image virtual hard disk. The virtual hard disk will be copied before + * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * + * @return the image value. + */ + public VirtualHardDisk image() { + return this.image; + } + + /** + * Set the image property: The source user image virtual hard disk. The virtual hard disk will be copied before + * being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * + * @param image the image value to set. + * @return the OSDisk object itself. + */ + public OSDisk withImage(VirtualHardDisk image) { + this.image = image; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None** for Standard storage. **ReadOnly** for Premium storage. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None** for Standard storage. **ReadOnly** for Premium storage. + * + * @param caching the caching value to set. + * @return the OSDisk object itself. + */ + public OSDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the OSDisk object itself. + */ + public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by + * the virtual machine. + * + * @return the diffDiskSettings value. + */ + public DiffDiskSettings diffDiskSettings() { + return this.diffDiskSettings; + } + + /** + * Set the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by + * the virtual machine. + * + * @param diffDiskSettings the diffDiskSettings value to set. + * @return the OSDisk object itself. + */ + public OSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings) { + this.diffDiskSettings = diffDiskSettings; + return this; + } + + /** + * Get the createOption property: Specifies how the virtual machine should be created.<br><br> Possible + * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to + * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an + * image to create the virtual machine. If you are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the plan element previously described. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machine should be created.<br><br> Possible + * values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to + * create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an + * image to create the virtual machine. If you are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the plan element previously described. + * + * @param createOption the createOption value to set. + * @return the OSDisk object itself. + */ + public OSDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the OSDisk object itself. + */ + public OSDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the OSDisk object itself. + */ + public OSDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. + * <br><br> Possible values: <br><br> **Delete** If this value is used, the OS disk is + * deleted when VM is deleted.<br><br> **Detach** If this value is used, the os disk is retained after + * VM is deleted. <br><br> The default value is set to **detach**. For an ephemeral OS Disk, the default + * value is set to **Delete**. User cannot change the delete option for ephemeral OS Disk. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. + * <br><br> Possible values: <br><br> **Delete** If this value is used, the OS disk is + * deleted when VM is deleted.<br><br> **Detach** If this value is used, the os disk is retained after + * VM is deleted. <br><br> The default value is set to **detach**. For an ephemeral OS Disk, the default + * value is set to **Delete**. User cannot change the delete option for ephemeral OS Disk. + * + * @param deleteOption the deleteOption value to set. + * @return the OSDisk object itself. + */ + public OSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().validate(); + } + if (vhd() != null) { + vhd().validate(); + } + if (image() != null) { + image().validate(); + } + if (diffDiskSettings() != null) { + diffDiskSettings().validate(); + } + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property createOption in model OSDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.java new file mode 100644 index 0000000000000..5237cdadc63cd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImage.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the os disk image information. */ +@Fluent +public final class OSDiskImage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDiskImage.class); + + /* + * The operating system of the osDiskImage. + */ + @JsonProperty(value = "operatingSystem", required = true) + private OperatingSystemTypes operatingSystem; + + /** + * Get the operatingSystem property: The operating system of the osDiskImage. + * + * @return the operatingSystem value. + */ + public OperatingSystemTypes operatingSystem() { + return this.operatingSystem; + } + + /** + * Set the operatingSystem property: The operating system of the osDiskImage. + * + * @param operatingSystem the operatingSystem value to set. + * @return the OSDiskImage object itself. + */ + public OSDiskImage withOperatingSystem(OperatingSystemTypes operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operatingSystem() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property operatingSystem in model OSDiskImage")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.java new file mode 100644 index 0000000000000..15af1fdc6d4a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDiskImageEncryption.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Contains encryption settings for an OS disk image. */ +@Fluent +public final class OSDiskImageEncryption extends DiskImageEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSDiskImageEncryption.class); + + /** {@inheritDoc} */ + @Override + public OSDiskImageEncryption withDiskEncryptionSetId(String diskEncryptionSetId) { + super.withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java new file mode 100644 index 0000000000000..2ea532fe1585b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamily.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; + +/** An immutable client-side representation of OSFamily. */ +public interface OSFamily { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: OS family properties. + * + * @return the properties value. + */ + OSFamilyProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner object. + * + * @return the inner object. + */ + OSFamilyInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java new file mode 100644 index 0000000000000..c397684f2444e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OSFamilyListResult model. */ +@Fluent +public final class OSFamilyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSFamilyListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the OSFamilyListResult object itself. + */ + public OSFamilyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the OSFamilyListResult object itself. + */ + public OSFamilyListResult 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 OSFamilyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java new file mode 100644 index 0000000000000..11c14d8ca4b08 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSFamilyProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OS family properties. */ +@Immutable +public final class OSFamilyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSFamilyProperties.class); + + /* + * The OS family name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The OS family label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * List of OS versions belonging to this family. + */ + @JsonProperty(value = "versions", access = JsonProperty.Access.WRITE_ONLY) + private List versions; + + /** + * Get the name property: The OS family name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the label property: The OS family label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the versions property: List of OS versions belonging to this family. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() != null) { + versions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.java new file mode 100644 index 0000000000000..bac02f2c65509 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is + * provisioned. + */ +@Fluent +public final class OSProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSProfile.class); + + /* + * Specifies the host OS name of the virtual machine.

    This name + * cannot be updated after the VM is created.

    **Max-length + * (Windows):** 15 characters

    **Max-length (Linux):** 64 + * characters.

    For naming conventions and restrictions see [Azure + * infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * Specifies the name of the administrator account.

    This property + * cannot be updated after the VM is created.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + * "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 + * character

    **Max-length (Linux):** 64 characters

    + * **Max-length (Windows):** 20 characters. + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 + * characters

    **Max-length (Linux):** 72 characters

    + * **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + *

    For resetting root password, see [Manage users, SSH, and check + * or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the + * Virtual Machine. The maximum length of the binary array is 65535 bytes. + *

    **Note: Do not pass any secrets or passwords in customData + * property**

    This property cannot be updated after the VM is + * created.

    customData is passed to the VM to be saved as a file, + * for more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/) + *

    For using cloud-init for your Linux VM, see [Using cloud-init + * to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies set of certificates that should be installed onto the virtual + * machine. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Specifies whether extension operations should be allowed on the virtual + * machine.

    This may only be set to False when no extensions are + * present on the virtual machine. + */ + @JsonProperty(value = "allowExtensionOperations") + private Boolean allowExtensionOperations; + + /* + * Specifies whether the guest provision signal is required to infer + * provision success of the virtual machine. **Note: This property is for + * private testing only, and all customers must not set the property to + * false.** + */ + @JsonProperty(value = "requireGuestProvisionSignal") + private Boolean requireGuestProvisionSignal; + + /** + * Get the computerName property: Specifies the host OS name of the virtual machine. <br><br> This name + * cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters + * <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: Specifies the host OS name of the virtual machine. <br><br> This name + * cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters + * <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + * + * @param computerName the computerName value to set. + * @return the OSProfile object itself. + */ + public OSProfile withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file, for more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For + * using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** + * <br><br> This property cannot be updated after the VM is created. <br><br> customData is + * passed to the VM to be saved as a file, for more information see [Custom Data on Azure + * VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For + * using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @param customData the customData value to set. + * @return the OSProfile object itself. + */ + public OSProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the windowsConfiguration value. + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machine. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Specifies set of certificates that should be installed onto the virtual machine. + * + * @param secrets the secrets value to set. + * @return the OSProfile object itself. + */ + public OSProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the allowExtensionOperations property: Specifies whether extension operations should be allowed on the + * virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual + * machine. + * + * @return the allowExtensionOperations value. + */ + public Boolean allowExtensionOperations() { + return this.allowExtensionOperations; + } + + /** + * Set the allowExtensionOperations property: Specifies whether extension operations should be allowed on the + * virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual + * machine. + * + * @param allowExtensionOperations the allowExtensionOperations value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAllowExtensionOperations(Boolean allowExtensionOperations) { + this.allowExtensionOperations = allowExtensionOperations; + return this; + } + + /** + * Get the requireGuestProvisionSignal property: Specifies whether the guest provision signal is required to infer + * provision success of the virtual machine. **Note: This property is for private testing only, and all customers + * must not set the property to false.**. + * + * @return the requireGuestProvisionSignal value. + */ + public Boolean requireGuestProvisionSignal() { + return this.requireGuestProvisionSignal; + } + + /** + * Set the requireGuestProvisionSignal property: Specifies whether the guest provision signal is required to infer + * provision success of the virtual machine. **Note: This property is for private testing only, and all customers + * must not set the property to false.**. + * + * @param requireGuestProvisionSignal the requireGuestProvisionSignal value to set. + * @return the OSProfile object itself. + */ + public OSProfile withRequireGuestProvisionSignal(Boolean requireGuestProvisionSignal) { + this.requireGuestProvisionSignal = requireGuestProvisionSignal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java new file mode 100644 index 0000000000000..b423efad99d64 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersion.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; + +/** An immutable client-side representation of OSVersion. */ +public interface OSVersion { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: OS version properties. + * + * @return the properties value. + */ + OSVersionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner object. + * + * @return the inner object. + */ + OSVersionInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java new file mode 100644 index 0000000000000..2cff82e297f98 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OSVersionListResult model. */ +@Fluent +public final class OSVersionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSVersionListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the OSVersionListResult object itself. + */ + public OSVersionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the OSVersionListResult object itself. + */ + public OSVersionListResult 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 OSVersionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java new file mode 100644 index 0000000000000..3375abb3f2086 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OS version properties. */ +@Immutable +public final class OSVersionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSVersionProperties.class); + + /* + * The family of this OS version. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The family label of this OS version. + */ + @JsonProperty(value = "familyLabel", access = JsonProperty.Access.WRITE_ONLY) + private String familyLabel; + + /* + * The OS version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The OS version label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * Specifies whether this is the default OS version for its family. + */ + @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDefault; + + /* + * Specifies whether this OS version is active. + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /** + * Get the family property: The family of this OS version. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the familyLabel property: The family label of this OS version. + * + * @return the familyLabel value. + */ + public String familyLabel() { + return this.familyLabel; + } + + /** + * Get the version property: The OS version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the label property: The OS version label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the isDefault property: Specifies whether this is the default OS version for its family. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the isActive property: Specifies whether this OS version is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java new file mode 100644 index 0000000000000..b9e28955473fa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSVersionPropertiesBase.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration view of an OS version. */ +@Immutable +public final class OSVersionPropertiesBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSVersionPropertiesBase.class); + + /* + * The OS version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The OS version label. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * Specifies whether this is the default OS version for its family. + */ + @JsonProperty(value = "isDefault", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDefault; + + /* + * Specifies whether this OS version is active. + */ + @JsonProperty(value = "isActive", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActive; + + /** + * Get the version property: The OS version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the label property: The OS version label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the isDefault property: Specifies whether this is the default OS version for its family. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the isActive property: Specifies whether this OS version is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java new file mode 100644 index 0000000000000..5d51e3c27eec0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemStateTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OperatingSystemStateTypes. */ +public enum OperatingSystemStateTypes { + /** Enum value Generalized. */ + GENERALIZED("Generalized"), + + /** Enum value Specialized. */ + SPECIALIZED("Specialized"); + + /** The actual serialized value for a OperatingSystemStateTypes instance. */ + private final String value; + + OperatingSystemStateTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperatingSystemStateTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed OperatingSystemStateTypes object, or null if unable to parse. + */ + @JsonCreator + public static OperatingSystemStateTypes fromString(String value) { + OperatingSystemStateTypes[] items = OperatingSystemStateTypes.values(); + for (OperatingSystemStateTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java new file mode 100644 index 0000000000000..86531fe7984b0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperatingSystemType. */ +public final class OperatingSystemType extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemType. */ + public static final OperatingSystemType WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemType. */ + public static final OperatingSystemType LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperatingSystemType. + */ + @JsonCreator + public static OperatingSystemType fromString(String name) { + return fromString(name, OperatingSystemType.class); + } + + /** @return known OperatingSystemType values. */ + public static Collection values() { + return values(OperatingSystemType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java new file mode 100644 index 0000000000000..9a552279c0b59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OperatingSystemTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OperatingSystemTypes. */ +public enum OperatingSystemTypes { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OperatingSystemTypes instance. */ + private final String value; + + OperatingSystemTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperatingSystemTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed OperatingSystemTypes object, or null if unable to parse. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String value) { + OperatingSystemTypes[] items = OperatingSystemTypes.values(); + for (OperatingSystemTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.java new file mode 100644 index 0000000000000..c0e96b8cc18b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of compute operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + PagedIterable list(); + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.java new file mode 100644 index 0000000000000..8f259b8d08aa8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrchestrationMode. */ +public final class OrchestrationMode extends ExpandableStringEnum { + /** Static value Uniform for OrchestrationMode. */ + public static final OrchestrationMode UNIFORM = fromString("Uniform"); + + /** Static value Flexible for OrchestrationMode. */ + public static final OrchestrationMode FLEXIBLE = fromString("Flexible"); + + /** + * Creates or finds a OrchestrationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestrationMode. + */ + @JsonCreator + public static OrchestrationMode fromString(String name) { + return fromString(name, OrchestrationMode.class); + } + + /** @return known OrchestrationMode values. */ + public static Collection values() { + return values(OrchestrationMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.java new file mode 100644 index 0000000000000..ad541120c58b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceNames.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrchestrationServiceNames. */ +public final class OrchestrationServiceNames extends ExpandableStringEnum { + /** Static value AutomaticRepairs for OrchestrationServiceNames. */ + public static final OrchestrationServiceNames AUTOMATIC_REPAIRS = fromString("AutomaticRepairs"); + + /** + * Creates or finds a OrchestrationServiceNames from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestrationServiceNames. + */ + @JsonCreator + public static OrchestrationServiceNames fromString(String name) { + return fromString(name, OrchestrationServiceNames.class); + } + + /** @return known OrchestrationServiceNames values. */ + public static Collection values() { + return values(OrchestrationServiceNames.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.java new file mode 100644 index 0000000000000..dd842f23ea94a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrchestrationServiceState. */ +public final class OrchestrationServiceState extends ExpandableStringEnum { + /** Static value NotRunning for OrchestrationServiceState. */ + public static final OrchestrationServiceState NOT_RUNNING = fromString("NotRunning"); + + /** Static value Running for OrchestrationServiceState. */ + public static final OrchestrationServiceState RUNNING = fromString("Running"); + + /** Static value Suspended for OrchestrationServiceState. */ + public static final OrchestrationServiceState SUSPENDED = fromString("Suspended"); + + /** + * Creates or finds a OrchestrationServiceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestrationServiceState. + */ + @JsonCreator + public static OrchestrationServiceState fromString(String name) { + return fromString(name, OrchestrationServiceState.class); + } + + /** @return known OrchestrationServiceState values. */ + public static Collection values() { + return values(OrchestrationServiceState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.java new file mode 100644 index 0000000000000..eed7dd00a20e9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrchestrationServiceStateAction. */ +public final class OrchestrationServiceStateAction extends ExpandableStringEnum { + /** Static value Resume for OrchestrationServiceStateAction. */ + public static final OrchestrationServiceStateAction RESUME = fromString("Resume"); + + /** Static value Suspend for OrchestrationServiceStateAction. */ + public static final OrchestrationServiceStateAction SUSPEND = fromString("Suspend"); + + /** + * Creates or finds a OrchestrationServiceStateAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestrationServiceStateAction. + */ + @JsonCreator + public static OrchestrationServiceStateAction fromString(String name) { + return fromString(name, OrchestrationServiceStateAction.class); + } + + /** @return known OrchestrationServiceStateAction values. */ + public static Collection values() { + return values(OrchestrationServiceStateAction.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.java new file mode 100644 index 0000000000000..8023b1498c63b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceStateInput.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The input for OrchestrationServiceState. */ +@Fluent +public final class OrchestrationServiceStateInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestrationServiceStateInput.class); + + /* + * The name of the service. + */ + @JsonProperty(value = "serviceName", required = true) + private OrchestrationServiceNames serviceName; + + /* + * The action to be performed. + */ + @JsonProperty(value = "action", required = true) + private OrchestrationServiceStateAction action; + + /** + * Get the serviceName property: The name of the service. + * + * @return the serviceName value. + */ + public OrchestrationServiceNames serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service. + * + * @param serviceName the serviceName value to set. + * @return the OrchestrationServiceStateInput object itself. + */ + public OrchestrationServiceStateInput withServiceName(OrchestrationServiceNames serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the action property: The action to be performed. + * + * @return the action value. + */ + public OrchestrationServiceStateAction action() { + return this.action; + } + + /** + * Set the action property: The action to be performed. + * + * @param action the action value to set. + * @return the OrchestrationServiceStateInput object itself. + */ + public OrchestrationServiceStateInput withAction(OrchestrationServiceStateAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model OrchestrationServiceStateInput")); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model OrchestrationServiceStateInput")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceSummary.java new file mode 100644 index 0000000000000..f024e0ce98a44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OrchestrationServiceSummary.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summary for an orchestration service of a virtual machine scale set. */ +@Immutable +public final class OrchestrationServiceSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestrationServiceSummary.class); + + /* + * The name of the service. + */ + @JsonProperty(value = "serviceName", access = JsonProperty.Access.WRITE_ONLY) + private OrchestrationServiceNames serviceName; + + /* + * The current state of the service. + */ + @JsonProperty(value = "serviceState", access = JsonProperty.Access.WRITE_ONLY) + private OrchestrationServiceState serviceState; + + /** + * Get the serviceName property: The name of the service. + * + * @return the serviceName value. + */ + public OrchestrationServiceNames serviceName() { + return this.serviceName; + } + + /** + * Get the serviceState property: The current state of the service. + * + * @return the serviceState value. + */ + public OrchestrationServiceState serviceState() { + return this.serviceState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java new file mode 100644 index 0000000000000..285549c1cd6a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PassNames.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for PassNames. */ +public enum PassNames { + /** Enum value OobeSystem. */ + OOBE_SYSTEM("OobeSystem"); + + /** The actual serialized value for a PassNames instance. */ + private final String value; + + PassNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PassNames instance. + * + * @param value the serialized value to parse. + * @return the parsed PassNames object, or null if unable to parse. + */ + @JsonCreator + public static PassNames fromString(String value) { + PassNames[] items = PassNames.values(); + for (PassNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.java new file mode 100644 index 0000000000000..6fb4844c63cd3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchAssessmentState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PatchAssessmentState. */ +public final class PatchAssessmentState extends ExpandableStringEnum { + /** Static value Unknown for PatchAssessmentState. */ + public static final PatchAssessmentState UNKNOWN = fromString("Unknown"); + + /** Static value Available for PatchAssessmentState. */ + public static final PatchAssessmentState AVAILABLE = fromString("Available"); + + /** + * Creates or finds a PatchAssessmentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchAssessmentState. + */ + @JsonCreator + public static PatchAssessmentState fromString(String name) { + return fromString(name, PatchAssessmentState.class); + } + + /** @return known PatchAssessmentState values. */ + public static Collection values() { + return values(PatchAssessmentState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.java new file mode 100644 index 0000000000000..3e74e2ab62627 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationDetail.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about a specific patch that was encountered during an installation action. */ +@Immutable +public final class PatchInstallationDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchInstallationDetail.class); + + /* + * A unique identifier for the patch. + */ + @JsonProperty(value = "patchId", access = JsonProperty.Access.WRITE_ONLY) + private String patchId; + + /* + * The friendly name of the patch. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The version string of the package. It may conform to Semantic + * Versioning. Only applies to Linux. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The KBID of the patch. Only applies to Windows patches. + */ + @JsonProperty(value = "kbId", access = JsonProperty.Access.WRITE_ONLY) + private String kbId; + + /* + * The classification(s) of the patch as provided by the patch publisher. + */ + @JsonProperty(value = "classifications", access = JsonProperty.Access.WRITE_ONLY) + private List classifications; + + /* + * The state of the patch after the installation operation completed. + */ + @JsonProperty(value = "installationState", access = JsonProperty.Access.WRITE_ONLY) + private PatchInstallationState installationState; + + /** + * Get the patchId property: A unique identifier for the patch. + * + * @return the patchId value. + */ + public String patchId() { + return this.patchId; + } + + /** + * Get the name property: The friendly name of the patch. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the version property: The version string of the package. It may conform to Semantic Versioning. Only applies + * to Linux. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the kbId property: The KBID of the patch. Only applies to Windows patches. + * + * @return the kbId value. + */ + public String kbId() { + return this.kbId; + } + + /** + * Get the classifications property: The classification(s) of the patch as provided by the patch publisher. + * + * @return the classifications value. + */ + public List classifications() { + return this.classifications; + } + + /** + * Get the installationState property: The state of the patch after the installation operation completed. + * + * @return the installationState value. + */ + public PatchInstallationState installationState() { + return this.installationState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.java new file mode 100644 index 0000000000000..e8bf94c2ffe10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchInstallationState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PatchInstallationState. */ +public final class PatchInstallationState extends ExpandableStringEnum { + /** Static value Unknown for PatchInstallationState. */ + public static final PatchInstallationState UNKNOWN = fromString("Unknown"); + + /** Static value Installed for PatchInstallationState. */ + public static final PatchInstallationState INSTALLED = fromString("Installed"); + + /** Static value Failed for PatchInstallationState. */ + public static final PatchInstallationState FAILED = fromString("Failed"); + + /** Static value Excluded for PatchInstallationState. */ + public static final PatchInstallationState EXCLUDED = fromString("Excluded"); + + /** Static value NotSelected for PatchInstallationState. */ + public static final PatchInstallationState NOT_SELECTED = fromString("NotSelected"); + + /** Static value Pending for PatchInstallationState. */ + public static final PatchInstallationState PENDING = fromString("Pending"); + + /** + * Creates or finds a PatchInstallationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchInstallationState. + */ + @JsonCreator + public static PatchInstallationState fromString(String name) { + return fromString(name, PatchInstallationState.class); + } + + /** @return known PatchInstallationState values. */ + public static Collection values() { + return values(PatchInstallationState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.java new file mode 100644 index 0000000000000..d3304fac645fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchOperationStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PatchOperationStatus. */ +public final class PatchOperationStatus extends ExpandableStringEnum { + /** Static value Unknown for PatchOperationStatus. */ + public static final PatchOperationStatus UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for PatchOperationStatus. */ + public static final PatchOperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for PatchOperationStatus. */ + public static final PatchOperationStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for PatchOperationStatus. */ + public static final PatchOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value CompletedWithWarnings for PatchOperationStatus. */ + public static final PatchOperationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * Creates or finds a PatchOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchOperationStatus. + */ + @JsonCreator + public static PatchOperationStatus fromString(String name) { + return fromString(name, PatchOperationStatus.class); + } + + /** @return known PatchOperationStatus values. */ + public static Collection values() { + return values(PatchOperationStatus.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.java new file mode 100644 index 0000000000000..3cb984653808d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies settings related to VM Guest Patching on Windows. */ +@Fluent +public final class PatchSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchSettings.class); + + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or + * virtual machines associated to virtual machine scale set with + * OrchestrationMode as Flexible.

    Possible values are:

    **Manual** - You control the application of patches to a virtual + * machine. You do this by applying patches manually inside the VM. In this + * mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false

    + * **AutomaticByOS** - The virtual machine will automatically be updated by + * the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true.

    **AutomaticByPlatform** - the virtual machine will + * automatically updated by the platform. The properties provisionVMAgent + * and WindowsConfiguration.enableAutomaticUpdates must be true + */ + @JsonProperty(value = "patchMode") + private WindowsVMGuestPatchMode patchMode; + + /* + * Enables customers to patch their Azure VMs without requiring a reboot. + * For enableHotpatching, the 'provisionVMAgent' must be set to true and + * 'patchMode' must be set to 'AutomaticByPlatform'. + */ + @JsonProperty(value = "enableHotpatching") + private Boolean enableHotpatching; + + /* + * Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.

    Possible values are:

    **ImageDefault** - + * You control the timing of patch assessments on a virtual machine.

    **AutomaticByPlatform** - The platform will trigger periodic + * patch assessments. The property provisionVMAgent must be true. + */ + @JsonProperty(value = "assessmentMode") + private WindowsPatchAssessmentMode assessmentMode; + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @return the patchMode value. + */ + public WindowsVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(WindowsVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @return the enableHotpatching value. + */ + public Boolean enableHotpatching() { + return this.enableHotpatching; + } + + /** + * Set the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @param enableHotpatching the enableHotpatching value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withEnableHotpatching(Boolean enableHotpatching) { + this.enableHotpatching = enableHotpatching; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public WindowsPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(WindowsPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirResource.java new file mode 100644 index 0000000000000..80da06f4a9e27 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirResource.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Resource model definition. */ +@Immutable +public class PirResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PirResource.class); + + /* + * Resource name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource location + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirSharedGalleryResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirSharedGalleryResource.java new file mode 100644 index 0000000000000..16d991db93ca8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PirSharedGalleryResource.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base information about the shared gallery resource in pir. */ +@JsonFlatten +@Fluent +public class PirSharedGalleryResource extends PirResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PirSharedGalleryResource.class); + + /* + * The unique id of this shared gallery. + */ + @JsonProperty(value = "identifier.uniqueId") + private String uniqueId; + + /** + * Get the uniqueId property: The unique id of this shared gallery. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Set the uniqueId property: The unique id of this shared gallery. + * + * @param uniqueId the uniqueId value to set. + * @return the PirSharedGalleryResource object itself. + */ + public PirSharedGalleryResource withUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Plan.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Plan.java new file mode 100644 index 0000000000000..31466108821c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Plan.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the marketplace image used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic + * use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and then click **Save**. + */ +@Fluent +public final class Plan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Plan.class); + + /* + * The plan ID. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the product of the image from the marketplace. This is the + * same value as Offer under the imageReference element. + */ + @JsonProperty(value = "product") + private String product; + + /* + * The promotion code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The promotion code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The promotion code. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpoint.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..376d9ec4c29f6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnection.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..1ece20de4095c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * 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 privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between DiskAccess and Virtual Network. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..0249ede75d930 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /* + * The uri to fetch the next page of snapshots. Call ListNext() with this + * to fetch the next page of snapshots. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the + * next page of snapshots. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the + * next page of snapshots. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..f83c6eb0977b9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..88512753013e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** @return known PrivateEndpointServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..7baaa755ebc10 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResource.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * private link resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * private link resource name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * private link resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the id property: private link resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: private link resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: private link resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResourceListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..c2fa9505f5566 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..5c4d1ebb402ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PrivateLinkServiceConnectionState.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java new file mode 100644 index 0000000000000..caaa15620d0dd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PropertyUpdatesInProgress.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the disk for which update is pending. */ +@Fluent +public final class PropertyUpdatesInProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PropertyUpdatesInProgress.class); + + /* + * The target performance tier of the disk if a tier change operation is in + * progress. + */ + @JsonProperty(value = "targetTier") + private String targetTier; + + /** + * Get the targetTier property: The target performance tier of the disk if a tier change operation is in progress. + * + * @return the targetTier value. + */ + public String targetTier() { + return this.targetTier; + } + + /** + * Set the targetTier property: The target performance tier of the disk if a tier change operation is in progress. + * + * @param targetTier the targetTier value to set. + * @return the PropertyUpdatesInProgress object itself. + */ + public PropertyUpdatesInProgress withTargetTier(String targetTier) { + this.targetTier = targetTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java new file mode 100644 index 0000000000000..dcae935dab597 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProtocolTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProtocolTypes. */ +public enum ProtocolTypes { + /** Enum value Http. */ + HTTP("Http"), + + /** Enum value Https. */ + HTTPS("Https"); + + /** The actual serialized value for a ProtocolTypes instance. */ + private final String value; + + ProtocolTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProtocolTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ProtocolTypes object, or null if unable to parse. + */ + @JsonCreator + public static ProtocolTypes fromString(String value) { + ProtocolTypes[] items = ProtocolTypes.values(); + for (ProtocolTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.java new file mode 100644 index 0000000000000..d616a12670bc4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroup.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ProximityPlacementGroup. */ +public interface ProximityPlacementGroup { + /** + * 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 proximityPlacementGroupType property: Specifies the type of the proximity placement group. + * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure + * region or Availability Zone. <br><br> **Ultra** : For future use. + * + * @return the proximityPlacementGroupType value. + */ + ProximityPlacementGroupType proximityPlacementGroupType(); + + /** + * Gets the virtualMachines property: A list of references to all virtual machines in the proximity placement group. + * + * @return the virtualMachines value. + */ + List virtualMachines(); + + /** + * Gets the virtualMachineScaleSets property: A list of references to all virtual machine scale sets in the + * proximity placement group. + * + * @return the virtualMachineScaleSets value. + */ + List virtualMachineScaleSets(); + + /** + * Gets the availabilitySets property: A list of references to all availability sets in the proximity placement + * group. + * + * @return the availabilitySets value. + */ + List availabilitySets(); + + /** + * Gets the colocationStatus property: Describes colocation status of the Proximity Placement Group. + * + * @return the colocationStatus value. + */ + InstanceViewStatus colocationStatus(); + + /** + * 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.compute.generated.fluent.models.ProximityPlacementGroupInner object. + * + * @return the inner object. + */ + ProximityPlacementGroupInner innerModel(); + + /** The entirety of the ProximityPlacementGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ProximityPlacementGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ProximityPlacementGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ProximityPlacementGroup 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 ProximityPlacementGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ProximityPlacementGroup 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.WithProximityPlacementGroupType, + DefinitionStages.WithColocationStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProximityPlacementGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProximityPlacementGroup create(Context context); + } + /** The stage of the ProximityPlacementGroup 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 ProximityPlacementGroup definition allowing to specify proximityPlacementGroupType. */ + interface WithProximityPlacementGroupType { + /** + * Specifies the proximityPlacementGroupType property: Specifies the type of the proximity placement group. + * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within + * an Azure region or Availability Zone. <br><br> **Ultra** : For future use.. + * + * @param proximityPlacementGroupType Specifies the type of the proximity placement group. + * <br><br> Possible values are: <br><br> **Standard** : Co-locate resources + * within an Azure region or Availability Zone. <br><br> **Ultra** : For future use. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroupType(ProximityPlacementGroupType proximityPlacementGroupType); + } + /** The stage of the ProximityPlacementGroup definition allowing to specify colocationStatus. */ + interface WithColocationStatus { + /** + * Specifies the colocationStatus property: Describes colocation status of the Proximity Placement Group.. + * + * @param colocationStatus Describes colocation status of the Proximity Placement Group. + * @return the next definition stage. + */ + WithCreate withColocationStatus(InstanceViewStatus colocationStatus); + } + } + /** + * Begins update for the ProximityPlacementGroup resource. + * + * @return the stage of resource update. + */ + ProximityPlacementGroup.Update update(); + + /** The template for ProximityPlacementGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProximityPlacementGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProximityPlacementGroup apply(Context context); + } + /** The ProximityPlacementGroup update stages. */ + interface UpdateStages { + /** The stage of the ProximityPlacementGroup 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. + */ + ProximityPlacementGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProximityPlacementGroup refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.java new file mode 100644 index 0000000000000..14551a4e76465 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupListResult.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.ProximityPlacementGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Proximity Placement Group operation response. */ +@Fluent +public final class ProximityPlacementGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupListResult.class); + + /* + * The list of proximity placement groups + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of proximity placement groups. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of proximity placement groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of proximity placement groups. + * + * @param value the value value to set. + * @return the ProximityPlacementGroupListResult object itself. + */ + public ProximityPlacementGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of proximity placement groups. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of proximity placement groups. + * + * @param nextLink the nextLink value to set. + * @return the ProximityPlacementGroupListResult object itself. + */ + public ProximityPlacementGroupListResult 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 ProximityPlacementGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.java new file mode 100644 index 0000000000000..3c9e6d00a42f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProximityPlacementGroupType. */ +public final class ProximityPlacementGroupType extends ExpandableStringEnum { + /** Static value Standard for ProximityPlacementGroupType. */ + public static final ProximityPlacementGroupType STANDARD = fromString("Standard"); + + /** Static value Ultra for ProximityPlacementGroupType. */ + public static final ProximityPlacementGroupType ULTRA = fromString("Ultra"); + + /** + * Creates or finds a ProximityPlacementGroupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProximityPlacementGroupType. + */ + @JsonCreator + public static ProximityPlacementGroupType fromString(String name) { + return fromString(name, ProximityPlacementGroupType.class); + } + + /** @return known ProximityPlacementGroupType values. */ + public static Collection values() { + return values(ProximityPlacementGroupType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java new file mode 100644 index 0000000000000..9b0bd5ab65c16 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroupUpdate.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Specifies information about the proximity placement group. */ +@Fluent +public final class ProximityPlacementGroupUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupUpdate.class); + + /** {@inheritDoc} */ + @Override + public ProximityPlacementGroupUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.java new file mode 100644 index 0000000000000..04ff9fb8a9d4e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProximityPlacementGroups.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 ProximityPlacementGroups. */ +public interface ProximityPlacementGroups { + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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. + */ + void deleteByResourceGroup(String resourceGroupName, String proximityPlacementGroupName); + + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 the response. + */ + Response deleteWithResponse(String resourceGroupName, String proximityPlacementGroupName, Context context); + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement 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 specifies information about the proximity placement group. + */ + ProximityPlacementGroup getByResourceGroup(String resourceGroupName, String proximityPlacementGroupName); + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String proximityPlacementGroupName, String includeColocationStatus, Context context); + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + PagedIterable list(); + + /** + * Lists all proximity placement groups 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 List Proximity Placement Group operation response. + */ + PagedIterable list(Context context); + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves information about a proximity placement group . + * + * @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 specifies information about the proximity placement group. + */ + ProximityPlacementGroup getById(String id); + + /** + * Retrieves information about a proximity placement group . + * + * @param id the resource ID. + * @param includeColocationStatus includeColocationStatus=true enables fetching the colocation status of all the + * resources in the proximity placement 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 specifies information about the proximity placement group. + */ + Response getByIdWithResponse(String id, String includeColocationStatus, Context context); + + /** + * Delete a proximity placement group. + * + * @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); + + /** + * Delete a proximity placement group. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProximityPlacementGroup resource. + * + * @param name resource name. + * @return the first stage of the new ProximityPlacementGroup definition. + */ + ProximityPlacementGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProxyOnlyResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProxyOnlyResource.java new file mode 100644 index 0000000000000..01714952217f4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ProxyOnlyResource.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ProxyOnly Resource model definition. */ +@Immutable +public class ProxyOnlyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProxyOnlyResource.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Resource name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java new file mode 100644 index 0000000000000..f5ac80a9d7522 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the public IP Sku. */ +@Fluent +public final class PublicIpAddressSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressSku.class); + + /* + * Specify public IP sku name + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Specify public IP sku tier + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** + * Get the name property: Specify public IP sku name. + * + * @return the name value. + */ + public PublicIpAddressSkuName name() { + return this.name; + } + + /** + * Set the name property: Specify public IP sku name. + * + * @param name the name value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withName(PublicIpAddressSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specify public IP sku tier. + * + * @return the tier value. + */ + public PublicIpAddressSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Specify public IP sku tier. + * + * @param tier the tier value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withTier(PublicIpAddressSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java new file mode 100644 index 0000000000000..c941d53a901c8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuName. */ +public final class PublicIpAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + @JsonCreator + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** @return known PublicIpAddressSkuName values. */ + public static Collection values() { + return values(PublicIpAddressSkuName.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java new file mode 100644 index 0000000000000..9b2534377c621 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAddressSkuTier.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuTier. */ +public final class PublicIpAddressSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + @JsonCreator + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** @return known PublicIpAddressSkuTier values. */ + public static Collection values() { + return values(PublicIpAddressSkuTier.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java new file mode 100644 index 0000000000000..5ef83fb399eb7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PublicIpAllocationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAllocationMethod. */ +public final class PublicIpAllocationMethod extends ExpandableStringEnum { + /** Static value Dynamic for PublicIpAllocationMethod. */ + public static final PublicIpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** Static value Static for PublicIpAllocationMethod. */ + public static final PublicIpAllocationMethod STATIC = fromString("Static"); + + /** + * Creates or finds a PublicIpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAllocationMethod. + */ + @JsonCreator + public static PublicIpAllocationMethod fromString(String name) { + return fromString(name, PublicIpAllocationMethod.class); + } + + /** @return known PublicIpAllocationMethod values. */ + public static Collection values() { + return values(PublicIpAllocationMethod.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java new file mode 100644 index 0000000000000..3f1d25b79a381 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlan.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurchasePlan.class); + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The plan ID. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the product of the image from the marketplace. This is the + * same value as Offer under the imageReference element. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @param product the product value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property publisher in model PurchasePlan")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model PurchasePlan")); + } + if (product() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property product in model PurchasePlan")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlanAutoGenerated.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlanAutoGenerated.java new file mode 100644 index 0000000000000..8475024ba5562 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PurchasePlanAutoGenerated.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlanAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurchasePlanAutoGenerated.class); + + /* + * The plan ID. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * Specifies the product of the image from the marketplace. This is the + * same value as Offer under the imageReference element. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * The Offer Promotion Code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the PurchasePlanAutoGenerated object itself. + */ + public PurchasePlanAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the PurchasePlanAutoGenerated object itself. + */ + public PurchasePlanAutoGenerated withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @param product the product value to set. + * @return the PurchasePlanAutoGenerated object itself. + */ + public PurchasePlanAutoGenerated withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The Offer Promotion Code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The Offer Promotion Code. + * + * @param promotionCode the promotionCode value to set. + * @return the PurchasePlanAutoGenerated object itself. + */ + public PurchasePlanAutoGenerated withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model PurchasePlanAutoGenerated")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisher in model PurchasePlanAutoGenerated")); + } + if (product() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property product in model PurchasePlanAutoGenerated")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecommendedMachineConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecommendedMachineConfiguration.java new file mode 100644 index 0000000000000..a722a0a60f43a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecommendedMachineConfiguration.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties describe the recommended machine configuration for this Image Definition. These properties are + * updatable. + */ +@Fluent +public final class RecommendedMachineConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendedMachineConfiguration.class); + + /* + * Describes the resource range. + */ + @JsonProperty(value = "vCPUs") + private ResourceRange vCPUs; + + /* + * Describes the resource range. + */ + @JsonProperty(value = "memory") + private ResourceRange memory; + + /** + * Get the vCPUs property: Describes the resource range. + * + * @return the vCPUs value. + */ + public ResourceRange vCPUs() { + return this.vCPUs; + } + + /** + * Set the vCPUs property: Describes the resource range. + * + * @param vCPUs the vCPUs value to set. + * @return the RecommendedMachineConfiguration object itself. + */ + public RecommendedMachineConfiguration withVCPUs(ResourceRange vCPUs) { + this.vCPUs = vCPUs; + return this; + } + + /** + * Get the memory property: Describes the resource range. + * + * @return the memory value. + */ + public ResourceRange memory() { + return this.memory; + } + + /** + * Set the memory property: Describes the resource range. + * + * @param memory the memory value to set. + * @return the RecommendedMachineConfiguration object itself. + */ + public RecommendedMachineConfiguration withMemory(ResourceRange memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vCPUs() != null) { + vCPUs().validate(); + } + if (memory() != null) { + memory().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecoveryWalkResponse.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecoveryWalkResponse.java new file mode 100644 index 0000000000000..b149333016c82 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RecoveryWalkResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner; + +/** An immutable client-side representation of RecoveryWalkResponse. */ +public interface RecoveryWalkResponse { + /** + * Gets the walkPerformed property: Whether the recovery walk was performed. + * + * @return the walkPerformed value. + */ + Boolean walkPerformed(); + + /** + * Gets the nextPlatformUpdateDomain property: The next update domain that needs to be walked. Null means walk + * spanning all update domains has been completed. + * + * @return the nextPlatformUpdateDomain value. + */ + Integer nextPlatformUpdateDomain(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RecoveryWalkResponseInner object. + * + * @return the inner object. + */ + RecoveryWalkResponseInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalReplicationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalReplicationStatus.java new file mode 100644 index 0000000000000..ef6374f85e816 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RegionalReplicationStatus.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the regional replication status. */ +@Immutable +public final class RegionalReplicationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionalReplicationStatus.class); + + /* + * The region to which the gallery image version is being replicated to. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * This is the regional replication state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationState state; + + /* + * The details of the replication status. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /* + * It indicates progress of the replication job. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private Integer progress; + + /** + * Get the region property: The region to which the gallery image version is being replicated to. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the state property: This is the regional replication state. + * + * @return the state value. + */ + public ReplicationState state() { + return this.state; + } + + /** + * Get the details property: The details of the replication status. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Get the progress property: It indicates progress of the replication job. + * + * @return the progress value. + */ + public Integer progress() { + return this.progress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.java new file mode 100644 index 0000000000000..5d99be44a0652 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicationState. */ +public final class ReplicationState extends ExpandableStringEnum { + /** Static value Unknown for ReplicationState. */ + public static final ReplicationState UNKNOWN = fromString("Unknown"); + + /** Static value Replicating for ReplicationState. */ + public static final ReplicationState REPLICATING = fromString("Replicating"); + + /** Static value Completed for ReplicationState. */ + public static final ReplicationState COMPLETED = fromString("Completed"); + + /** Static value Failed for ReplicationState. */ + public static final ReplicationState FAILED = fromString("Failed"); + + /** + * Creates or finds a ReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationState. + */ + @JsonCreator + public static ReplicationState fromString(String name) { + return fromString(name, ReplicationState.class); + } + + /** @return known ReplicationState values. */ + public static Collection values() { + return values(ReplicationState.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.java new file mode 100644 index 0000000000000..b35e2a0bfd69c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatus.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** This is the replication status of the gallery image version. */ +@Immutable +public final class ReplicationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationStatus.class); + + /* + * This is the aggregated replication status based on all the regional + * replication status flags. + */ + @JsonProperty(value = "aggregatedState", access = JsonProperty.Access.WRITE_ONLY) + private AggregatedReplicationState aggregatedState; + + /* + * This is a summary of replication status for each region. + */ + @JsonProperty(value = "summary", access = JsonProperty.Access.WRITE_ONLY) + private List summary; + + /** + * Get the aggregatedState property: This is the aggregated replication status based on all the regional replication + * status flags. + * + * @return the aggregatedState value. + */ + public AggregatedReplicationState aggregatedState() { + return this.aggregatedState; + } + + /** + * Get the summary property: This is a summary of replication status for each region. + * + * @return the summary value. + */ + public List summary() { + return this.summary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summary() != null) { + summary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.java new file mode 100644 index 0000000000000..2a8475c6a049b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ReplicationStatusTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicationStatusTypes. */ +public final class ReplicationStatusTypes extends ExpandableStringEnum { + /** Static value ReplicationStatus for ReplicationStatusTypes. */ + public static final ReplicationStatusTypes REPLICATION_STATUS = fromString("ReplicationStatus"); + + /** + * Creates or finds a ReplicationStatusTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationStatusTypes. + */ + @JsonCreator + public static ReplicationStatusTypes fromString(String name) { + return fromString(name, ReplicationStatusTypes.class); + } + + /** @return known ReplicationStatusTypes values. */ + public static Collection values() { + return values(ReplicationStatusTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.java new file mode 100644 index 0000000000000..20afc3af1ec8f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RequestRateByIntervalInput.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Api request input for LogAnalytics getRequestRateByInterval Api. */ +@Fluent +public final class RequestRateByIntervalInput extends LogAnalyticsInputBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestRateByIntervalInput.class); + + /* + * Interval value in minutes used to create LogAnalytics call rate logs. + */ + @JsonProperty(value = "intervalLength", required = true) + private IntervalInMins intervalLength; + + /** + * Get the intervalLength property: Interval value in minutes used to create LogAnalytics call rate logs. + * + * @return the intervalLength value. + */ + public IntervalInMins intervalLength() { + return this.intervalLength; + } + + /** + * Set the intervalLength property: Interval value in minutes used to create LogAnalytics call rate logs. + * + * @param intervalLength the intervalLength value to set. + * @return the RequestRateByIntervalInput object itself. + */ + public RequestRateByIntervalInput withIntervalLength(IntervalInMins intervalLength) { + this.intervalLength = intervalLength; + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withBlobContainerSasUri(String blobContainerSasUri) { + super.withBlobContainerSasUri(blobContainerSasUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withFromTime(OffsetDateTime fromTime) { + super.withFromTime(fromTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withToTime(OffsetDateTime toTime) { + super.withToTime(toTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { + super.withGroupByThrottlePolicy(groupByThrottlePolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withGroupByOperationName(Boolean groupByOperationName) { + super.withGroupByOperationName(groupByOperationName); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withGroupByResourceName(Boolean groupByResourceName) { + super.withGroupByResourceName(groupByResourceName); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withGroupByClientApplicationId(Boolean groupByClientApplicationId) { + super.withGroupByClientApplicationId(groupByClientApplicationId); + return this; + } + + /** {@inheritDoc} */ + @Override + public RequestRateByIntervalInput withGroupByUserAgent(Boolean groupByUserAgent) { + super.withGroupByUserAgent(groupByUserAgent); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (intervalLength() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property intervalLength in model RequestRateByIntervalInput")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..2a1c65564a404 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceIdentityType.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.java new file mode 100644 index 0000000000000..cb96f68844100 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceInstanceViewStatus.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Instance view status. */ +@Fluent +public final class ResourceInstanceViewStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceInstanceViewStatus.class); + + /* + * The status code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime time; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the ResourceInstanceViewStatus object itself. + */ + public ResourceInstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java new file mode 100644 index 0000000000000..49518fdd3108d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the resource range. */ +@Fluent +public final class ResourceRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceRange.class); + + /* + * The minimum number of the resource. + */ + @JsonProperty(value = "min") + private Integer min; + + /* + * The maximum number of the resource. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get the min property: The minimum number of the resource. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum number of the resource. + * + * @param min the min value to set. + * @return the ResourceRange object itself. + */ + public ResourceRange withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max property: The maximum number of the resource. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum number of the resource. + * + * @param max the max value to set. + * @return the ResourceRange object itself. + */ + public ResourceRange withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSku.java new file mode 100644 index 0000000000000..787f51a467941 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSku.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import java.util.List; + +/** An immutable client-side representation of ResourceSku. */ +public interface ResourceSku { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the size property: The Size of the SKU. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: The Family of this particular SKU. + * + * @return the family value. + */ + String family(); + + /** + * Gets the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * Gets the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner object. + * + * @return the inner object. + */ + ResourceSkuInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapabilities.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..ec66b4acb4853 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapabilities.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes The SKU capabilities object. */ +@Immutable +public final class ResourceSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); + + /* + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: An invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: An invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacity.java new file mode 100644 index 0000000000000..0c506e35a04c6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacity.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapacity.class); + + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /* + * The maximum capacity that can be set. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /* + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /* + * The scale type applicable to the sku. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The maximum capacity that can be set. + * + * @return the maximum value. + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scaleType property: The scale type applicable to the sku. + * + * @return the scaleType value. + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.java new file mode 100644 index 0000000000000..edccdc5770d35 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCapacityScaleType.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceSkuCapacityScaleType. */ +public enum ResourceSkuCapacityScaleType { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value Manual. */ + MANUAL("Manual"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceSkuCapacityScaleType instance. */ + private final String value; + + ResourceSkuCapacityScaleType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuCapacityScaleType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuCapacityScaleType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String value) { + ResourceSkuCapacityScaleType[] items = ResourceSkuCapacityScaleType.values(); + for (ResourceSkuCapacityScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCosts.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCosts.java new file mode 100644 index 0000000000000..f402221d790ed --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuCosts.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes metadata for retrieving price info. */ +@Immutable +public final class ResourceSkuCosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCosts.class); + + /* + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /* + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /* + * An invariant to show the extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get the meterId property: Used for querying price from commerce. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the quantity property: The multiplier is needed to extend the base metered cost. + * + * @return the quantity value. + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get the extendedUnit property: An invariant to show the extended unit. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.java new file mode 100644 index 0000000000000..51ee9a935c129 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuLocationInfo.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuLocationInfo model. */ +@Immutable +public final class ResourceSkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuLocationInfo.class); + + /* + * Location of the SKU + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * List of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /* + * Details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails", access = JsonProperty.Access.WRITE_ONLY) + private List zoneDetails; + + /** + * Get the location property: Location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the zones property: List of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the zoneDetails property: Details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionInfo.java new file mode 100644 index 0000000000000..a0b27fcaac17d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionInfo.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuRestrictionInfo model. */ +@Immutable +public final class ResourceSkuRestrictionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictionInfo.class); + + /* + * Locations where the SKU is restricted + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * List of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /** + * Get the locations property: Locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the zones property: List of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..f77516eb364a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictions.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); + + /* + * The type of restrictions. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsType type; + + /* + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionInfo restrictionInfo; + + /* + * The reason for restriction. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type property: The type of restrictions. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Get the reasonCode property: The reason for restriction. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..05622944323ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceSkuRestrictionsReasonCode. */ +public enum ResourceSkuRestrictionsReasonCode { + /** Enum value QuotaId. */ + QUOTA_ID("QuotaId"), + + /** Enum value NotAvailableForSubscription. */ + NOT_AVAILABLE_FOR_SUBSCRIPTION("NotAvailableForSubscription"); + + /** The actual serialized value for a ResourceSkuRestrictionsReasonCode instance. */ + private final String value; + + ResourceSkuRestrictionsReasonCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuRestrictionsReasonCode instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuRestrictionsReasonCode object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String value) { + ResourceSkuRestrictionsReasonCode[] items = ResourceSkuRestrictionsReasonCode.values(); + for (ResourceSkuRestrictionsReasonCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..47b056fec98a9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuRestrictionsType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceSkuRestrictionsType. */ +public enum ResourceSkuRestrictionsType { + /** Enum value Location. */ + LOCATION("Location"), + + /** Enum value Zone. */ + ZONE("Zone"); + + /** The actual serialized value for a ResourceSkuRestrictionsType instance. */ + private final String value; + + ResourceSkuRestrictionsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceSkuRestrictionsType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceSkuRestrictionsType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String value) { + ResourceSkuRestrictionsType[] items = ResourceSkuRestrictionsType.values(); + for (ResourceSkuRestrictionsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.java new file mode 100644 index 0000000000000..f989c9f1e4a4e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkuZoneDetails.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes The zonal capabilities of a SKU. */ +@Immutable +public final class ResourceSkuZoneDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuZoneDetails.class); + + /* + * The set of zones that the SKU is available in with the specified + * capabilities. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private List name; + + /* + * A list of capabilities that are available for the SKU in the specified + * list of zones. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * Get the name property: The set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Get the capabilities property: A list of capabilities that are available for the SKU in the specified list of + * zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.java new file mode 100644 index 0000000000000..3162b3cec072f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkus.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceSkus. */ +public interface ResourceSkus { + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 list of Microsoft. + */ + PagedIterable list(); + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.java new file mode 100644 index 0000000000000..70e08f018db65 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceSkusResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.ResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Resource Skus operation response. */ +@Fluent +public final class ResourceSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusResult.class); + + /* + * The list of skus available for the subscription. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of Resource Skus. Call ListNext() with + * this URI to fetch the next page of Resource Skus + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of skus available for the subscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of skus available for the subscription. + * + * @param value the value value to set. + * @return the ResourceSkusResult object itself. + */ + public ResourceSkusResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to + * fetch the next page of Resource Skus. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to + * fetch the next page of Resource Skus. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkusResult object itself. + */ + public ResourceSkusResult 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 ResourceSkusResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.java new file mode 100644 index 0000000000000..36869e3863e68 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ResourceUriList.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List resources which are encrypted with the disk encryption set. */ +@Fluent +public final class ResourceUriList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUriList.class); + + /* + * A list of IDs or Owner IDs of resources which are encrypted with the + * disk encryption set. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of encrypted resources. Call ListNext() + * with this to fetch the next page of encrypted resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. + * + * @param value the value value to set. + * @return the ResourceUriList object itself. + */ + public ResourceUriList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of encrypted resources. Call ListNext() with this to + * fetch the next page of encrypted resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of encrypted resources. Call ListNext() with this to + * fetch the next page of encrypted resources. + * + * @param nextLink the nextLink value to set. + * @return the ResourceUriList object itself. + */ + public ResourceUriList 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 ResourceUriList")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java new file mode 100644 index 0000000000000..5b380f9b5234d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoint.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import java.util.List; + +/** An immutable client-side representation of RestorePoint. */ +public interface RestorePoint { + /** + * 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 excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore + * point. If no disks are specified, all disks will be included. + * + * @return the excludeDisks value. + */ + List excludeDisks(); + + /** + * Gets the sourceMetadata property: Gets the details of the VM captured at the time of the restore point creation. + * + * @return the sourceMetadata value. + */ + RestorePointSourceMetadata sourceMetadata(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the restore point. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the consistencyMode property: Gets the consistency mode for the restore point. Please refer to + * https://aka.ms/RestorePoints for more details. + * + * @return the consistencyMode value. + */ + ConsistencyModeTypes consistencyMode(); + + /** + * Gets the provisioningDetails property: Gets the provisioning details set by the server during Create restore + * point operation. + * + * @return the provisioningDetails value. + */ + RestorePointProvisioningDetails provisioningDetails(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner object. + * + * @return the inner object. + */ + RestorePointInner innerModel(); + + /** The entirety of the RestorePoint definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The RestorePoint definition stages. */ + interface DefinitionStages { + /** The first stage of the RestorePoint definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RestorePoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, restorePointCollectionName. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @return the next definition stage. + */ + WithCreate withExistingRestorePointCollection(String resourceGroupName, String restorePointCollectionName); + } + /** + * The stage of the RestorePoint 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.WithExcludeDisks { + /** + * Executes the create request. + * + * @return the created resource. + */ + RestorePoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RestorePoint create(Context context); + } + /** The stage of the RestorePoint definition allowing to specify excludeDisks. */ + interface WithExcludeDisks { + /** + * Specifies the excludeDisks property: List of disk resource ids that the customer wishes to exclude from + * the restore point. If no disks are specified, all disks will be included.. + * + * @param excludeDisks List of disk resource ids that the customer wishes to exclude from the restore point. + * If no disks are specified, all disks will be included. + * @return the next definition stage. + */ + WithCreate withExcludeDisks(List excludeDisks); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RestorePoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RestorePoint refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java new file mode 100644 index 0000000000000..e033f02e1072c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollection.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RestorePointCollection. */ +public interface RestorePointCollection { + /** + * 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 source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + RestorePointCollectionSourceProperties source(); + + /** + * Gets the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + String restorePointCollectionId(); + + /** + * Gets the restorePoints property: A list containing all restore points created under this restore point + * collection. + * + * @return the restorePoints value. + */ + List restorePoints(); + + /** + * 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.compute.generated.fluent.models.RestorePointCollectionInner object. + * + * @return the inner object. + */ + RestorePointCollectionInner innerModel(); + + /** The entirety of the RestorePointCollection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RestorePointCollection definition stages. */ + interface DefinitionStages { + /** The first stage of the RestorePointCollection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RestorePointCollection 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 RestorePointCollection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RestorePointCollection 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.WithSource { + /** + * Executes the create request. + * + * @return the created resource. + */ + RestorePointCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RestorePointCollection create(Context context); + } + /** The stage of the RestorePointCollection 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 RestorePointCollection definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The properties of the source resource that this restore point collection + * is created from.. + * + * @param source The properties of the source resource that this restore point collection is created from. + * @return the next definition stage. + */ + WithCreate withSource(RestorePointCollectionSourceProperties source); + } + } + /** + * Begins update for the RestorePointCollection resource. + * + * @return the stage of resource update. + */ + RestorePointCollection.Update update(); + + /** The template for RestorePointCollection update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSource { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RestorePointCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RestorePointCollection apply(Context context); + } + /** The RestorePointCollection update stages. */ + interface UpdateStages { + /** The stage of the RestorePointCollection 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); + } + /** The stage of the RestorePointCollection update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The properties of the source resource that this restore point collection + * is created from.. + * + * @param source The properties of the source resource that this restore point collection is created from. + * @return the next definition stage. + */ + Update withSource(RestorePointCollectionSourceProperties source); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RestorePointCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RestorePointCollection refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java new file mode 100644 index 0000000000000..309a6d4ee4c83 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionExpandOptions.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestorePointCollectionExpandOptions. */ +public final class RestorePointCollectionExpandOptions + extends ExpandableStringEnum { + /** Static value restorePoints for RestorePointCollectionExpandOptions. */ + public static final RestorePointCollectionExpandOptions RESTORE_POINTS = fromString("restorePoints"); + + /** + * Creates or finds a RestorePointCollectionExpandOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointCollectionExpandOptions. + */ + @JsonCreator + public static RestorePointCollectionExpandOptions fromString(String name) { + return fromString(name, RestorePointCollectionExpandOptions.class); + } + + /** @return known RestorePointCollectionExpandOptions values. */ + public static Collection values() { + return values(RestorePointCollectionExpandOptions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java new file mode 100644 index 0000000000000..5c7199178f689 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointCollectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List restore point collection operation response. */ +@Fluent +public final class RestorePointCollectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointCollectionListResult.class); + + /* + * Gets the list of restore point collections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The uri to fetch the next page of RestorePointCollections. Call + * ListNext() with this to fetch the next page of RestorePointCollections + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets the list of restore point collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of restore point collections. + * + * @param value the value value to set. + * @return the RestorePointCollectionListResult object itself. + */ + public RestorePointCollectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of RestorePointCollections. Call ListNext() with this + * to fetch the next page of RestorePointCollections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of RestorePointCollections. Call ListNext() with this + * to fetch the next page of RestorePointCollections. + * + * @param nextLink the nextLink value to set. + * @return the RestorePointCollectionListResult object itself. + */ + public RestorePointCollectionListResult 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java new file mode 100644 index 0000000000000..bf56212075100 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionSourceProperties.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the source resource that this restore point collection is created from. */ +@Fluent +public final class RestorePointCollectionSourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointCollectionSourceProperties.class); + + /* + * Location of the source resource used to create this restore point + * collection. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Resource Id of the source resource used to create this restore point + * collection + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the location property: Location of the source resource used to create this restore point collection. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the id property: Resource Id of the source resource used to create this restore point collection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of the source resource used to create this restore point collection. + * + * @param id the id value to set. + * @return the RestorePointCollectionSourceProperties object itself. + */ + public RestorePointCollectionSourceProperties 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java new file mode 100644 index 0000000000000..99eb8c984ac81 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollectionUpdate.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.RestorePointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Update Restore Point collection parameters. */ +@JsonFlatten +@Fluent +public class RestorePointCollectionUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointCollectionUpdate.class); + + /* + * The properties of the source resource that this restore point collection + * is created from. + */ + @JsonProperty(value = "properties.source") + private RestorePointCollectionSourceProperties source; + + /* + * The provisioning state of the restore point collection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique id of the restore point collection. + */ + @JsonProperty(value = "properties.restorePointCollectionId", access = JsonProperty.Access.WRITE_ONLY) + private String restorePointCollectionId; + + /* + * A list containing all restore points created under this restore point + * collection. + */ + @JsonProperty(value = "properties.restorePoints", access = JsonProperty.Access.WRITE_ONLY) + private List restorePoints; + + /** + * Get the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @return the source value. + */ + public RestorePointCollectionSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The properties of the source resource that this restore point collection is created + * from. + * + * @param source the source value to set. + * @return the RestorePointCollectionUpdate object itself. + */ + public RestorePointCollectionUpdate withSource(RestorePointCollectionSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the restore point collection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the restorePointCollectionId property: The unique id of the restore point collection. + * + * @return the restorePointCollectionId value. + */ + public String restorePointCollectionId() { + return this.restorePointCollectionId; + } + + /** + * Get the restorePoints property: A list containing all restore points created under this restore point collection. + * + * @return the restorePoints value. + */ + public List restorePoints() { + return this.restorePoints; + } + + /** {@inheritDoc} */ + @Override + public RestorePointCollectionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (source() != null) { + source().validate(); + } + if (restorePoints() != null) { + restorePoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java new file mode 100644 index 0000000000000..4f2ae432c3eea --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointCollections.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 RestorePointCollections. */ +public interface RestorePointCollections { + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, Context context); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + RestorePointCollection getByResourceGroup(String resourceGroupName, String restorePointCollectionName); + + /** + * The operation to get the restore point collection. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, + String restorePointCollectionName, + RestorePointCollectionExpandOptions expand, + Context context); + + /** + * Gets the list of restore point collections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the list of restore point collections 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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + PagedIterable list(); + + /** + * Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the + * next page of restore point collections. Do this till nextLink is not null to fetch all the restore point + * collections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of restore point collections in the subscription. + */ + PagedIterable list(Context context); + + /** + * The operation to get the restore point collection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + RestorePointCollection getById(String id); + + /** + * The operation to get the restore point collection. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. If expand=restorePoints, server will return all + * contained restore points in the restorePointCollection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return create or update Restore Point collection parameters. + */ + Response getByIdWithResponse( + String id, RestorePointCollectionExpandOptions expand, Context context); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete the restore point collection. This operation will also delete all the contained restore + * points. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new RestorePointCollection resource. + * + * @param name resource name. + * @return the first stage of the new RestorePointCollection definition. + */ + RestorePointCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointProvisioningDetails.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointProvisioningDetails.java new file mode 100644 index 0000000000000..6f65c31c4fde2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointProvisioningDetails.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Restore Point Provisioning details. */ +@Fluent +public final class RestorePointProvisioningDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointProvisioningDetails.class); + + /* + * Gets the creation time of the restore point. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /* + * Gets the total size of the data in all the disks which are part of the + * restore point. + */ + @JsonProperty(value = "totalUsedSizeInBytes") + private Long totalUsedSizeInBytes; + + /* + * Gets the status of the Create restore point operation. + */ + @JsonProperty(value = "statusCode") + private Integer statusCode; + + /* + * Gets the status message of the Create restore point operation. + */ + @JsonProperty(value = "statusMessage") + private String statusMessage; + + /** + * Get the creationTime property: Gets the creation time of the restore point. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Gets the creation time of the restore point. + * + * @param creationTime the creationTime value to set. + * @return the RestorePointProvisioningDetails object itself. + */ + public RestorePointProvisioningDetails withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the totalUsedSizeInBytes property: Gets the total size of the data in all the disks which are part of the + * restore point. + * + * @return the totalUsedSizeInBytes value. + */ + public Long totalUsedSizeInBytes() { + return this.totalUsedSizeInBytes; + } + + /** + * Set the totalUsedSizeInBytes property: Gets the total size of the data in all the disks which are part of the + * restore point. + * + * @param totalUsedSizeInBytes the totalUsedSizeInBytes value to set. + * @return the RestorePointProvisioningDetails object itself. + */ + public RestorePointProvisioningDetails withTotalUsedSizeInBytes(Long totalUsedSizeInBytes) { + this.totalUsedSizeInBytes = totalUsedSizeInBytes; + return this; + } + + /** + * Get the statusCode property: Gets the status of the Create restore point operation. + * + * @return the statusCode value. + */ + public Integer statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: Gets the status of the Create restore point operation. + * + * @param statusCode the statusCode value to set. + * @return the RestorePointProvisioningDetails object itself. + */ + public RestorePointProvisioningDetails withStatusCode(Integer statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the statusMessage property: Gets the status message of the Create restore point operation. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Set the statusMessage property: Gets the status message of the Create restore point operation. + * + * @param statusMessage the statusMessage value to set. + * @return the RestorePointProvisioningDetails object itself. + */ + public RestorePointProvisioningDetails withStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java new file mode 100644 index 0000000000000..d621e98f9fde0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceMetadata.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are + * a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point + * creation. + */ +@Fluent +public final class RestorePointSourceMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointSourceMetadata.class); + + /* + * Gets the hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Gets the storage profile. + */ + @JsonProperty(value = "storageProfile") + private RestorePointSourceVMStorageProfile storageProfile; + + /* + * Gets the OS profile. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * Gets the diagnostics profile. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Gets the license type, which is for bring your own license scenario. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Gets the virtual machine unique id. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /* + * Gets the security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Location of the VM from which the restore point was created. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the hardwareProfile property: Gets the hardware profile. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Gets the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile property: Gets the storage profile. + * + * @return the storageProfile value. + */ + public RestorePointSourceVMStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Gets the storage profile. + * + * @param storageProfile the storageProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withStorageProfile(RestorePointSourceVMStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the osProfile property: Gets the OS profile. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Gets the OS profile. + * + * @param osProfile the osProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Gets the diagnostics profile. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Gets the diagnostics profile. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the licenseType property: Gets the license type, which is for bring your own license scenario. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Gets the license type, which is for bring your own license scenario. + * + * @param licenseType the licenseType value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the vmId property: Gets the virtual machine unique id. + * + * @return the vmId value. + */ + public String vmId() { + return this.vmId; + } + + /** + * Set the vmId property: Gets the virtual machine unique id. + * + * @param vmId the vmId value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get the securityProfile property: Gets the security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Gets the security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the location property: Location of the VM from which the restore point was created. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the VM from which the restore point was created. + * + * @param location the location value to set. + * @return the RestorePointSourceMetadata object itself. + */ + public RestorePointSourceMetadata withLocation(String location) { + this.location = location; + 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 (osProfile() != null) { + osProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java new file mode 100644 index 0000000000000..1706d47ffed78 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMDataDisk.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a data disk. */ +@Fluent +public final class RestorePointSourceVMDataDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointSourceVMDataDisk.class); + + /* + * Gets the logical unit number. + */ + @JsonProperty(value = "lun") + private Integer lun; + + /* + * Gets the disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the caching type. + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Gets the initial disk size in GB for blank data disks, and the new + * desired size for existing OS and Data disks. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * Gets the managed disk details + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Gets the disk restore point Id. + */ + @JsonProperty(value = "diskRestorePoint") + private ApiEntityReference diskRestorePoint; + + /** + * Get the lun property: Gets the logical unit number. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Set the lun property: Gets the logical unit number. + * + * @param lun the lun value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withLun(Integer lun) { + this.lun = lun; + return this; + } + + /** + * Get the name property: Gets the disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the disk name. + * + * @param name the name value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the caching property: Gets the caching type. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Gets the caching type. + * + * @param caching the caching value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the diskSizeGB property: Gets the initial disk size in GB for blank data disks, and the new desired size for + * existing OS and Data disks. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Gets the initial disk size in GB for blank data disks, and the new desired size for + * existing OS and Data disks. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: Gets the managed disk details. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: Gets the managed disk details. + * + * @param managedDisk the managedDisk value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskRestorePoint property: Gets the disk restore point Id. + * + * @return the diskRestorePoint value. + */ + public ApiEntityReference diskRestorePoint() { + return this.diskRestorePoint; + } + + /** + * Set the diskRestorePoint property: Gets the disk restore point Id. + * + * @param diskRestorePoint the diskRestorePoint value to set. + * @return the RestorePointSourceVMDataDisk object itself. + */ + public RestorePointSourceVMDataDisk withDiskRestorePoint(ApiEntityReference diskRestorePoint) { + this.diskRestorePoint = diskRestorePoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedDisk() != null) { + managedDisk().validate(); + } + if (diskRestorePoint() != null) { + diskRestorePoint().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java new file mode 100644 index 0000000000000..a0fe32f4f213f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVMStorageProfile.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the storage profile. */ +@Fluent +public final class RestorePointSourceVMStorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointSourceVMStorageProfile.class); + + /* + * Gets the OS disk of the VM captured at the time of the restore point + * creation. + */ + @JsonProperty(value = "osDisk") + private RestorePointSourceVmosDisk osDisk; + + /* + * Gets the data disks of the VM captured at the time of the restore point + * creation. + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the osDisk property: Gets the OS disk of the VM captured at the time of the restore point creation. + * + * @return the osDisk value. + */ + public RestorePointSourceVmosDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Gets the OS disk of the VM captured at the time of the restore point creation. + * + * @param osDisk the osDisk value to set. + * @return the RestorePointSourceVMStorageProfile object itself. + */ + public RestorePointSourceVMStorageProfile withOsDisk(RestorePointSourceVmosDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Gets the data disks of the VM captured at the time of the restore point creation. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Gets the data disks of the VM captured at the time of the restore point creation. + * + * @param dataDisks the dataDisks value to set. + * @return the RestorePointSourceVMStorageProfile object itself. + */ + public RestorePointSourceVMStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java new file mode 100644 index 0000000000000..e9c24d723e533 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePointSourceVmosDisk.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an Operating System disk. */ +@Fluent +public final class RestorePointSourceVmosDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointSourceVmosDisk.class); + + /* + * Gets the Operating System type. + */ + @JsonProperty(value = "osType") + private OperatingSystemType osType; + + /* + * Gets the disk encryption settings. + */ + @JsonProperty(value = "encryptionSettings") + private DiskEncryptionSettings encryptionSettings; + + /* + * Gets the disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the caching type. + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Gets the disk size in GB. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * Gets the managed disk details + */ + @JsonProperty(value = "managedDisk") + private ManagedDiskParameters managedDisk; + + /* + * Gets the disk restore point Id. + */ + @JsonProperty(value = "diskRestorePoint") + private ApiEntityReference diskRestorePoint; + + /** + * Get the osType property: Gets the Operating System type. + * + * @return the osType value. + */ + public OperatingSystemType osType() { + return this.osType; + } + + /** + * Set the osType property: Gets the Operating System type. + * + * @param osType the osType value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withOsType(OperatingSystemType osType) { + this.osType = osType; + return this; + } + + /** + * Get the encryptionSettings property: Gets the disk encryption settings. + * + * @return the encryptionSettings value. + */ + public DiskEncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set the encryptionSettings property: Gets the disk encryption settings. + * + * @param encryptionSettings the encryptionSettings value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get the name property: Gets the disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the disk name. + * + * @param name the name value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the caching property: Gets the caching type. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Gets the caching type. + * + * @param caching the caching value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the diskSizeGB property: Gets the disk size in GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Gets the disk size in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: Gets the managed disk details. + * + * @return the managedDisk value. + */ + public ManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: Gets the managed disk details. + * + * @param managedDisk the managedDisk value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withManagedDisk(ManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskRestorePoint property: Gets the disk restore point Id. + * + * @return the diskRestorePoint value. + */ + public ApiEntityReference diskRestorePoint() { + return this.diskRestorePoint; + } + + /** + * Set the diskRestorePoint property: Gets the disk restore point Id. + * + * @param diskRestorePoint the diskRestorePoint value to set. + * @return the RestorePointSourceVmosDisk object itself. + */ + public RestorePointSourceVmosDisk withDiskRestorePoint(ApiEntityReference diskRestorePoint) { + this.diskRestorePoint = diskRestorePoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionSettings() != null) { + encryptionSettings().validate(); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + if (diskRestorePoint() != null) { + diskRestorePoint().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java new file mode 100644 index 0000000000000..799c7bdf615da --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RestorePoints.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RestorePoints. */ +public interface RestorePoints { + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, String restorePointName); + + /** + * The operation to delete the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the Restore Point Collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + RestorePoint get(String resourceGroupName, String restorePointCollectionName, String restorePointName); + + /** + * The operation to get the restore point. + * + * @param resourceGroupName The name of the resource group. + * @param restorePointCollectionName The name of the restore point collection. + * @param restorePointName The name of the restore point. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + Response getWithResponse( + String resourceGroupName, String restorePointCollectionName, String restorePointName, Context context); + + /** + * The operation to get the restore point. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + RestorePoint getById(String id); + + /** + * The operation to get the restore point. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return restore Point details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The operation to delete the restore point. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete the restore point. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new RestorePoint resource. + * + * @param name resource name. + * @return the first stage of the new RestorePoint definition. + */ + RestorePoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java new file mode 100644 index 0000000000000..a5e5d34634cf8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RetrieveBootDiagnosticsDataResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner; + +/** An immutable client-side representation of RetrieveBootDiagnosticsDataResult. */ +public interface RetrieveBootDiagnosticsDataResult { + /** + * Gets the consoleScreenshotBlobUri property: The console screenshot blob URI. + * + * @return the consoleScreenshotBlobUri value. + */ + String consoleScreenshotBlobUri(); + + /** + * Gets the serialConsoleLogBlobUri property: The serial console log blob URI. + * + * @return the serialConsoleLogBlobUri value. + */ + String serialConsoleLogBlobUri(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RetrieveBootDiagnosticsDataResultInner + * object. + * + * @return the inner object. + */ + RetrieveBootDiagnosticsDataResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java new file mode 100644 index 0000000000000..7ab22b5772a9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstance.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of RoleInstance. */ +public interface RoleInstance { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource Type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The sku property. + * + * @return the sku value. + */ + InstanceSku sku(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + RoleInstanceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner object. + * + * @return the inner object. + */ + RoleInstanceInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java new file mode 100644 index 0000000000000..b47919bd2ef2c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RoleInstanceListResult model. */ +@Fluent +public final class RoleInstanceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstanceListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the RoleInstanceListResult object itself. + */ + public RoleInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the RoleInstanceListResult object itself. + */ + public RoleInstanceListResult 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 RoleInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java new file mode 100644 index 0000000000000..f30a392edc144 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceNetworkProfile.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the network profile for the role instance. */ +@Immutable +public final class RoleInstanceNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstanceNetworkProfile.class); + + /* + * Specifies the list of resource Ids for the network interfaces associated + * with the role instance. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /** + * Get the networkInterfaces property: Specifies the list of resource Ids for the network interfaces associated with + * the role instance. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java new file mode 100644 index 0000000000000..5fe29b9f1d2c7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceProperties.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner; + +/** An immutable client-side representation of RoleInstanceProperties. */ +public interface RoleInstanceProperties { + /** + * Gets the networkProfile property: Describes the network profile for the role instance. + * + * @return the networkProfile value. + */ + RoleInstanceNetworkProfile networkProfile(); + + /** + * Gets the instanceView property: The instance view of the role instance. + * + * @return the instanceView value. + */ + RoleInstanceView instanceView(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstancePropertiesInner object. + * + * @return the inner object. + */ + RoleInstancePropertiesInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.java new file mode 100644 index 0000000000000..9018d06fe96f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstanceView.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of RoleInstanceView. */ +public interface RoleInstanceView { + /** + * Gets the platformUpdateDomain property: The Update Domain. + * + * @return the platformUpdateDomain value. + */ + Integer platformUpdateDomain(); + + /** + * Gets the platformFaultDomain property: The Fault Domain. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the privateId property: Specifies a unique identifier generated internally for the cloud service associated + * with this role instance. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this + * property can be used as 'DeploymentId' for querying details. + * + * @return the privateId value. + */ + String privateId(); + + /** + * Gets the statuses property: The statuses property. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner object. + * + * @return the inner object. + */ + RoleInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.java new file mode 100644 index 0000000000000..19d1e4a587bb3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RoleInstances.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a list of role instances from the cloud service. */ +@Fluent +public final class RoleInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInstances.class); + + /* + * List of cloud service role instance names. Value of '*' will signify all + * role instances of the cloud service. + */ + @JsonProperty(value = "roleInstances", required = true) + private List roleInstances; + + /** + * Get the roleInstances property: List of cloud service role instance names. Value of '*' will signify all role + * instances of the cloud service. + * + * @return the roleInstances value. + */ + public List roleInstances() { + return this.roleInstances; + } + + /** + * Set the roleInstances property: List of cloud service role instance names. Value of '*' will signify all role + * instances of the cloud service. + * + * @param roleInstances the roleInstances value to set. + * @return the RoleInstances object itself. + */ + public RoleInstances withRoleInstances(List roleInstances) { + this.roleInstances = roleInstances; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleInstances() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property roleInstances in model RoleInstances")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollbackStatusInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollbackStatusInfo.java new file mode 100644 index 0000000000000..e327989edb836 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollbackStatusInfo.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about rollback on failed VM instances after a OS Upgrade operation. */ +@Immutable +public final class RollbackStatusInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RollbackStatusInfo.class); + + /* + * The number of instances which have been successfully rolled back. + */ + @JsonProperty(value = "successfullyRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer successfullyRolledbackInstanceCount; + + /* + * The number of instances which failed to rollback. + */ + @JsonProperty(value = "failedRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedRolledbackInstanceCount; + + /* + * Error details if OS rollback failed. + */ + @JsonProperty(value = "rollbackError", access = JsonProperty.Access.WRITE_ONLY) + private ApiError rollbackError; + + /** + * Get the successfullyRolledbackInstanceCount property: The number of instances which have been successfully rolled + * back. + * + * @return the successfullyRolledbackInstanceCount value. + */ + public Integer successfullyRolledbackInstanceCount() { + return this.successfullyRolledbackInstanceCount; + } + + /** + * Get the failedRolledbackInstanceCount property: The number of instances which failed to rollback. + * + * @return the failedRolledbackInstanceCount value. + */ + public Integer failedRolledbackInstanceCount() { + return this.failedRolledbackInstanceCount; + } + + /** + * Get the rollbackError property: Error details if OS rollback failed. + * + * @return the rollbackError value. + */ + public ApiError rollbackError() { + return this.rollbackError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rollbackError() != null) { + rollbackError().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.java new file mode 100644 index 0000000000000..0f4475a50fba2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RollingUpgradeActionType. */ +public enum RollingUpgradeActionType { + /** Enum value Start. */ + START("Start"), + + /** Enum value Cancel. */ + CANCEL("Cancel"); + + /** The actual serialized value for a RollingUpgradeActionType instance. */ + private final String value; + + RollingUpgradeActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RollingUpgradeActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed RollingUpgradeActionType object, or null if unable to parse. + */ + @JsonCreator + public static RollingUpgradeActionType fromString(String value) { + RollingUpgradeActionType[] items = RollingUpgradeActionType.values(); + for (RollingUpgradeActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java new file mode 100644 index 0000000000000..56aecaba87c00 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradePolicy.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration parameters used while performing a rolling upgrade. */ +@Fluent +public final class RollingUpgradePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradePolicy.class); + + /* + * The maximum percent of total virtual machine instances that will be + * upgraded simultaneously by the rolling upgrade in one batch. As this is + * a maximum, unhealthy instances in previous or future batches can cause + * the percentage of instances in a batch to decrease to ensure higher + * reliability. The default value for this parameter is 20%. + */ + @JsonProperty(value = "maxBatchInstancePercent") + private Integer maxBatchInstancePercent; + + /* + * The maximum percentage of the total virtual machine instances in the + * scale set that can be simultaneously unhealthy, either as a result of + * being upgraded, or by being found in an unhealthy state by the virtual + * machine health checks before the rolling upgrade aborts. This constraint + * will be checked prior to starting any batch. The default value for this + * parameter is 20%. + */ + @JsonProperty(value = "maxUnhealthyInstancePercent") + private Integer maxUnhealthyInstancePercent; + + /* + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each + * batch is upgraded. If this percentage is ever exceeded, the rolling + * update aborts. The default value for this parameter is 20%. + */ + @JsonProperty(value = "maxUnhealthyUpgradedInstancePercent") + private Integer maxUnhealthyUpgradedInstancePercent; + + /* + * The wait time between completing the update for all virtual machines in + * one batch and starting the next batch. The time duration should be + * specified in ISO 8601 format. The default value is 0 seconds (PT0S). + */ + @JsonProperty(value = "pauseTimeBetweenBatches") + private String pauseTimeBetweenBatches; + + /* + * Allow VMSS to ignore AZ boundaries when constructing upgrade batches. + * Take into consideration the Update Domain and maxBatchInstancePercent to + * determine the batch size. + */ + @JsonProperty(value = "enableCrossZoneUpgrade") + private Boolean enableCrossZoneUpgrade; + + /* + * Upgrade all unhealthy instances in a scale set before any healthy + * instances. + */ + @JsonProperty(value = "prioritizeUnhealthyInstances") + private Boolean prioritizeUnhealthyInstances; + + /** + * Get the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be + * upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in + * previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher + * reliability. The default value for this parameter is 20%. + * + * @return the maxBatchInstancePercent value. + */ + public Integer maxBatchInstancePercent() { + return this.maxBatchInstancePercent; + } + + /** + * Set the maxBatchInstancePercent property: The maximum percent of total virtual machine instances that will be + * upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in + * previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher + * reliability. The default value for this parameter is 20%. + * + * @param maxBatchInstancePercent the maxBatchInstancePercent value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withMaxBatchInstancePercent(Integer maxBatchInstancePercent) { + this.maxBatchInstancePercent = maxBatchInstancePercent; + return this; + } + + /** + * Get the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in + * the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an + * unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is 20%. + * + * @return the maxUnhealthyInstancePercent value. + */ + public Integer maxUnhealthyInstancePercent() { + return this.maxUnhealthyInstancePercent; + } + + /** + * Set the maxUnhealthyInstancePercent property: The maximum percentage of the total virtual machine instances in + * the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an + * unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is 20%. + * + * @param maxUnhealthyInstancePercent the maxUnhealthyInstancePercent value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withMaxUnhealthyInstancePercent(Integer maxUnhealthyInstancePercent) { + this.maxUnhealthyInstancePercent = maxUnhealthyInstancePercent; + return this; + } + + /** + * Get the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine + * instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If + * this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. + * + * @return the maxUnhealthyUpgradedInstancePercent value. + */ + public Integer maxUnhealthyUpgradedInstancePercent() { + return this.maxUnhealthyUpgradedInstancePercent; + } + + /** + * Set the maxUnhealthyUpgradedInstancePercent property: The maximum percentage of upgraded virtual machine + * instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If + * this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. + * + * @param maxUnhealthyUpgradedInstancePercent the maxUnhealthyUpgradedInstancePercent value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withMaxUnhealthyUpgradedInstancePercent(Integer maxUnhealthyUpgradedInstancePercent) { + this.maxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent; + return this; + } + + /** + * Get the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in + * one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default + * value is 0 seconds (PT0S). + * + * @return the pauseTimeBetweenBatches value. + */ + public String pauseTimeBetweenBatches() { + return this.pauseTimeBetweenBatches; + } + + /** + * Set the pauseTimeBetweenBatches property: The wait time between completing the update for all virtual machines in + * one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default + * value is 0 seconds (PT0S). + * + * @param pauseTimeBetweenBatches the pauseTimeBetweenBatches value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withPauseTimeBetweenBatches(String pauseTimeBetweenBatches) { + this.pauseTimeBetweenBatches = pauseTimeBetweenBatches; + return this; + } + + /** + * Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. + * Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. + * + * @return the enableCrossZoneUpgrade value. + */ + public Boolean enableCrossZoneUpgrade() { + return this.enableCrossZoneUpgrade; + } + + /** + * Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. + * Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. + * + * @param enableCrossZoneUpgrade the enableCrossZoneUpgrade value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade) { + this.enableCrossZoneUpgrade = enableCrossZoneUpgrade; + return this; + } + + /** + * Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy + * instances. + * + * @return the prioritizeUnhealthyInstances value. + */ + public Boolean prioritizeUnhealthyInstances() { + return this.prioritizeUnhealthyInstances; + } + + /** + * Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy + * instances. + * + * @param prioritizeUnhealthyInstances the prioritizeUnhealthyInstances value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances) { + this.prioritizeUnhealthyInstances = prioritizeUnhealthyInstances; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeProgressInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeProgressInfo.java new file mode 100644 index 0000000000000..904abc23d9c43 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeProgressInfo.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about the number of virtual machine instances in each upgrade state. */ +@Immutable +public final class RollingUpgradeProgressInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeProgressInfo.class); + + /* + * The number of instances that have been successfully upgraded. + */ + @JsonProperty(value = "successfulInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer successfulInstanceCount; + + /* + * The number of instances that have failed to be upgraded successfully. + */ + @JsonProperty(value = "failedInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedInstanceCount; + + /* + * The number of instances that are currently being upgraded. + */ + @JsonProperty(value = "inProgressInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer inProgressInstanceCount; + + /* + * The number of instances that have not yet begun to be upgraded. + */ + @JsonProperty(value = "pendingInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer pendingInstanceCount; + + /** + * Get the successfulInstanceCount property: The number of instances that have been successfully upgraded. + * + * @return the successfulInstanceCount value. + */ + public Integer successfulInstanceCount() { + return this.successfulInstanceCount; + } + + /** + * Get the failedInstanceCount property: The number of instances that have failed to be upgraded successfully. + * + * @return the failedInstanceCount value. + */ + public Integer failedInstanceCount() { + return this.failedInstanceCount; + } + + /** + * Get the inProgressInstanceCount property: The number of instances that are currently being upgraded. + * + * @return the inProgressInstanceCount value. + */ + public Integer inProgressInstanceCount() { + return this.inProgressInstanceCount; + } + + /** + * Get the pendingInstanceCount property: The number of instances that have not yet begun to be upgraded. + * + * @return the pendingInstanceCount value. + */ + public Integer pendingInstanceCount() { + return this.pendingInstanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeRunningStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeRunningStatus.java new file mode 100644 index 0000000000000..e8fd4c89ee73a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeRunningStatus.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about the current running state of the overall upgrade. */ +@Immutable +public final class RollingUpgradeRunningStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeRunningStatus.class); + + /* + * Code indicating the current status of the upgrade. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeStatusCode code; + + /* + * Start time of the upgrade. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The last action performed on the rolling upgrade. + */ + @JsonProperty(value = "lastAction", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeActionType lastAction; + + /* + * Last action time of the upgrade. + */ + @JsonProperty(value = "lastActionTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastActionTime; + + /** + * Get the code property: Code indicating the current status of the upgrade. + * + * @return the code value. + */ + public RollingUpgradeStatusCode code() { + return this.code; + } + + /** + * Get the startTime property: Start time of the upgrade. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the lastAction property: The last action performed on the rolling upgrade. + * + * @return the lastAction value. + */ + public RollingUpgradeActionType lastAction() { + return this.lastAction; + } + + /** + * Get the lastActionTime property: Last action time of the upgrade. + * + * @return the lastActionTime value. + */ + public OffsetDateTime lastActionTime() { + return this.lastActionTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.java new file mode 100644 index 0000000000000..a10151a61ecee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusCode.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RollingUpgradeStatusCode. */ +public enum RollingUpgradeStatusCode { + /** Enum value RollingForward. */ + ROLLING_FORWARD("RollingForward"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Faulted. */ + FAULTED("Faulted"); + + /** The actual serialized value for a RollingUpgradeStatusCode instance. */ + private final String value; + + RollingUpgradeStatusCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RollingUpgradeStatusCode instance. + * + * @param value the serialized value to parse. + * @return the parsed RollingUpgradeStatusCode object, or null if unable to parse. + */ + @JsonCreator + public static RollingUpgradeStatusCode fromString(String value) { + RollingUpgradeStatusCode[] items = RollingUpgradeStatusCode.values(); + for (RollingUpgradeStatusCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusInfo.java new file mode 100644 index 0000000000000..e4561fff1a369 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RollingUpgradeStatusInfo.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner; +import java.util.Map; + +/** An immutable client-side representation of RollingUpgradeStatusInfo. */ +public interface RollingUpgradeStatusInfo { + /** + * 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 policy property: The rolling upgrade policies applied for this upgrade. + * + * @return the policy value. + */ + RollingUpgradePolicy policy(); + + /** + * Gets the runningStatus property: Information about the current running state of the overall upgrade. + * + * @return the runningStatus value. + */ + RollingUpgradeRunningStatus runningStatus(); + + /** + * Gets the progress property: Information about the number of virtual machine instances in each upgrade state. + * + * @return the progress value. + */ + RollingUpgradeProgressInfo progress(); + + /** + * Gets the error property: Error details for this upgrade, if there are any. + * + * @return the error value. + */ + ApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RollingUpgradeStatusInfoInner object. + * + * @return the inner object. + */ + RollingUpgradeStatusInfoInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocument.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocument.java new file mode 100644 index 0000000000000..b2dd93266888f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocument.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner; +import java.util.List; + +/** An immutable client-side representation of RunCommandDocument. */ +public interface RunCommandDocument { + /** + * Gets the schema property: The VM run command schema. + * + * @return the schema value. + */ + String schema(); + + /** + * Gets the id property: The VM run command id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the osType property: The Operating System type. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the label property: The VM run command label. + * + * @return the label value. + */ + String label(); + + /** + * Gets the description property: The VM run command description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the script property: The script to be executed. + * + * @return the script value. + */ + List script(); + + /** + * Gets the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentInner object. + * + * @return the inner object. + */ + RunCommandDocumentInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocumentBase.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocumentBase.java new file mode 100644 index 0000000000000..a48e0629fd9c5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandDocumentBase.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; + +/** An immutable client-side representation of RunCommandDocumentBase. */ +public interface RunCommandDocumentBase { + /** + * Gets the schema property: The VM run command schema. + * + * @return the schema value. + */ + String schema(); + + /** + * Gets the id property: The VM run command id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the osType property: The Operating System type. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the label property: The VM run command label. + * + * @return the label value. + */ + String label(); + + /** + * Gets the description property: The VM run command description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner object. + * + * @return the inner object. + */ + RunCommandDocumentBaseInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.java new file mode 100644 index 0000000000000..ed850108402cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInput.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Capture Virtual Machine parameters. */ +@Fluent +public final class RunCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandInput.class); + + /* + * The run command id. + */ + @JsonProperty(value = "commandId", required = true) + private String commandId; + + /* + * Optional. The script to be executed. When this value is given, the + * given script will override the default script of the command. + */ + @JsonProperty(value = "script") + private List script; + + /* + * The run command parameters. + */ + @JsonProperty(value = "parameters") + private List parameters; + + /** + * Get the commandId property: The run command id. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Set the commandId property: The run command id. + * + * @param commandId the commandId value to set. + * @return the RunCommandInput object itself. + */ + public RunCommandInput withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + + /** + * Get the script property: Optional. The script to be executed. When this value is given, the given script will + * override the default script of the command. + * + * @return the script value. + */ + public List script() { + return this.script; + } + + /** + * Set the script property: Optional. The script to be executed. When this value is given, the given script will + * override the default script of the command. + * + * @param script the script value to set. + * @return the RunCommandInput object itself. + */ + public RunCommandInput withScript(List script) { + this.script = script; + return this; + } + + /** + * Get the parameters property: The run command parameters. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The run command parameters. + * + * @param parameters the parameters value to set. + * @return the RunCommandInput object itself. + */ + public RunCommandInput withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (commandId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property commandId in model RunCommandInput")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.java new file mode 100644 index 0000000000000..3ab22547e1ab6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandInputParameter.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a run command parameter. */ +@Fluent +public final class RunCommandInputParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandInputParameter.class); + + /* + * The run command parameter name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The run command parameter value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: The run command parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The run command parameter name. + * + * @param name the name value to set. + * @return the RunCommandInputParameter object itself. + */ + public RunCommandInputParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The run command parameter value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The run command parameter value. + * + * @param value the value value to set. + * @return the RunCommandInputParameter object itself. + */ + public RunCommandInputParameter withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RunCommandInputParameter")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model RunCommandInputParameter")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.java new file mode 100644 index 0000000000000..ac7e3f9bf185a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandDocumentBaseInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class RunCommandListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandListResult.class); + + /* + * The list of virtual machine run commands. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of run commands. Call ListNext() with + * this to fetch the next page of run commands. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of virtual machine run commands. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine run commands. + * + * @param value the value value to set. + * @return the RunCommandListResult object itself. + */ + public RunCommandListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the + * next page of run commands. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of run commands. Call ListNext() with this to fetch the + * next page of run commands. + * + * @param nextLink the nextLink value to set. + * @return the RunCommandListResult object itself. + */ + public RunCommandListResult 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 RunCommandListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandParameterDefinition.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandParameterDefinition.java new file mode 100644 index 0000000000000..54714154ce7f9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandParameterDefinition.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a run command parameter. */ +@Fluent +public final class RunCommandParameterDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandParameterDefinition.class); + + /* + * The run command parameter name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The run command parameter type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * The run command parameter default value. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /* + * The run command parameter required. + */ + @JsonProperty(value = "required") + private Boolean required; + + /** + * Get the name property: The run command parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The run command parameter name. + * + * @param name the name value to set. + * @return the RunCommandParameterDefinition object itself. + */ + public RunCommandParameterDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The run command parameter type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The run command parameter type. + * + * @param type the type value to set. + * @return the RunCommandParameterDefinition object itself. + */ + public RunCommandParameterDefinition withType(String type) { + this.type = type; + return this; + } + + /** + * Get the defaultValue property: The run command parameter default value. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: The run command parameter default value. + * + * @param defaultValue the defaultValue value to set. + * @return the RunCommandParameterDefinition object itself. + */ + public RunCommandParameterDefinition withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the required property: The run command parameter required. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: The run command parameter required. + * + * @param required the required value to set. + * @return the RunCommandParameterDefinition object itself. + */ + public RunCommandParameterDefinition withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model RunCommandParameterDefinition")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model RunCommandParameterDefinition")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandResult.java new file mode 100644 index 0000000000000..9b84e3c981d0f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/RunCommandResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner; +import java.util.List; + +/** An immutable client-side representation of RunCommandResult. */ +public interface RunCommandResult { + /** + * Gets the value property: Run command operation response. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.RunCommandResultInner object. + * + * @return the inner object. + */ + RunCommandResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScaleInPolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScaleInPolicy.java new file mode 100644 index 0000000000000..2895798637dd7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScaleInPolicy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a scale-in policy for a virtual machine scale set. */ +@Fluent +public final class ScaleInPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleInPolicy.class); + + /* + * The rules to be followed when scaling-in a virtual machine scale set. + *

    Possible values are:

    **Default** When a virtual + * machine scale set is scaled in, the scale set will first be balanced + * across zones if it is a zonal scale set. Then, it will be balanced + * across Fault Domains as far as possible. Within each Fault Domain, the + * virtual machines chosen for removal will be the newest ones that are not + * protected from scale-in.

    **OldestVM** When a virtual machine + * scale set is being scaled-in, the oldest virtual machines that are not + * protected from scale-in will be chosen for removal. For zonal virtual + * machine scale sets, the scale set will first be balanced across zones. + * Within each zone, the oldest virtual machines that are not protected + * will be chosen for removal.

    **NewestVM** When a virtual machine + * scale set is being scaled-in, the newest virtual machines that are not + * protected from scale-in will be chosen for removal. For zonal virtual + * machine scale sets, the scale set will first be balanced across zones. + * Within each zone, the newest virtual machines that are not protected + * will be chosen for removal.

    + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the rules property: The rules to be followed when scaling-in a virtual machine scale set. + * <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is + * scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be + * balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for + * removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a + * virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in + * will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across + * zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. + * <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual + * machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, + * the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not + * protected will be chosen for removal. <br><br>. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The rules to be followed when scaling-in a virtual machine scale set. + * <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is + * scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be + * balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for + * removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a + * virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in + * will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across + * zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. + * <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual + * machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, + * the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not + * protected will be chosen for removal. <br><br>. + * + * @param rules the rules value to set. + * @return the ScaleInPolicy object itself. + */ + public ScaleInPolicy withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScheduledEventsProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScheduledEventsProfile.java new file mode 100644 index 0000000000000..105e6832c72b9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ScheduledEventsProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ScheduledEventsProfile model. */ +@Fluent +public final class ScheduledEventsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduledEventsProfile.class); + + /* + * Specifies Terminate Scheduled Event related configurations. + */ + @JsonProperty(value = "terminateNotificationProfile") + private TerminateNotificationProfile terminateNotificationProfile; + + /** + * Get the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. + * + * @return the terminateNotificationProfile value. + */ + public TerminateNotificationProfile terminateNotificationProfile() { + return this.terminateNotificationProfile; + } + + /** + * Set the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. + * + * @param terminateNotificationProfile the terminateNotificationProfile value to set. + * @return the ScheduledEventsProfile object itself. + */ + public ScheduledEventsProfile withTerminateNotificationProfile( + TerminateNotificationProfile terminateNotificationProfile) { + this.terminateNotificationProfile = terminateNotificationProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminateNotificationProfile() != null) { + terminateNotificationProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityProfile.java new file mode 100644 index 0000000000000..5ad76aed0b1a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityProfile.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the Security profile settings for the virtual machine or virtual machine scale set. */ +@Fluent +public final class SecurityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityProfile.class); + + /* + * Specifies the security settings like secure boot and vTPM used while + * creating the virtual machine.

    Minimum api-version: 2020-12-01 + */ + @JsonProperty(value = "uefiSettings") + private UefiSettings uefiSettings; + + /* + * This property can be used by user in the request to enable or disable + * the Host Encryption for the virtual machine or virtual machine scale + * set. This will enable the encryption for all the disks including + * Resource/Temp disk at host itself.

    Default: The Encryption at + * host will be disabled unless this property is set to true for the + * resource. + */ + @JsonProperty(value = "encryptionAtHost") + private Boolean encryptionAtHost; + + /* + * Specifies the SecurityType of the virtual machine. It is set as + * TrustedLaunch to enable UefiSettings.

    Default: UefiSettings + * will not be enabled unless this property is set as TrustedLaunch. + */ + @JsonProperty(value = "securityType") + private SecurityTypes securityType; + + /** + * Get the uefiSettings property: Specifies the security settings like secure boot and vTPM used while creating the + * virtual machine. <br><br>Minimum api-version: 2020-12-01. + * + * @return the uefiSettings value. + */ + public UefiSettings uefiSettings() { + return this.uefiSettings; + } + + /** + * Set the uefiSettings property: Specifies the security settings like secure boot and vTPM used while creating the + * virtual machine. <br><br>Minimum api-version: 2020-12-01. + * + * @param uefiSettings the uefiSettings value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withUefiSettings(UefiSettings uefiSettings) { + this.uefiSettings = uefiSettings; + return this; + } + + /** + * Get the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host + * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the + * disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be + * disabled unless this property is set to true for the resource. + * + * @return the encryptionAtHost value. + */ + public Boolean encryptionAtHost() { + return this.encryptionAtHost; + } + + /** + * Set the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host + * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the + * disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be + * disabled unless this property is set to true for the resource. + * + * @param encryptionAtHost the encryptionAtHost value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withEncryptionAtHost(Boolean encryptionAtHost) { + this.encryptionAtHost = encryptionAtHost; + return this; + } + + /** + * Get the securityType property: Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to + * enable UefiSettings. <br><br> Default: UefiSettings will not be enabled unless this property is set + * as TrustedLaunch. + * + * @return the securityType value. + */ + public SecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to + * enable UefiSettings. <br><br> Default: UefiSettings will not be enabled unless this property is set + * as TrustedLaunch. + * + * @param securityType the securityType value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withSecurityType(SecurityTypes securityType) { + this.securityType = securityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uefiSettings() != null) { + uefiSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.java new file mode 100644 index 0000000000000..175e7461c3336 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityTypes. */ +public final class SecurityTypes extends ExpandableStringEnum { + /** Static value TrustedLaunch for SecurityTypes. */ + public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * Creates or finds a SecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityTypes. + */ + @JsonCreator + public static SecurityTypes fromString(String name) { + return fromString(name, SecurityTypes.class); + } + + /** @return known SecurityTypes values. */ + public static Collection values() { + return values(SecurityTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java new file mode 100644 index 0000000000000..89cae4c2d5cbf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SelectPermissions.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SelectPermissions. */ +public final class SelectPermissions extends ExpandableStringEnum { + /** Static value Permissions for SelectPermissions. */ + public static final SelectPermissions PERMISSIONS = fromString("Permissions"); + + /** + * Creates or finds a SelectPermissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding SelectPermissions. + */ + @JsonCreator + public static SelectPermissions fromString(String name) { + return fromString(name, SelectPermissions.class); + } + + /** @return known SelectPermissions values. */ + public static Collection values() { + return values(SelectPermissions.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SettingNames.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SettingNames.java new file mode 100644 index 0000000000000..596f085543969 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SettingNames.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SettingNames. */ +public enum SettingNames { + /** Enum value AutoLogon. */ + AUTO_LOGON("AutoLogon"), + + /** Enum value FirstLogonCommands. */ + FIRST_LOGON_COMMANDS("FirstLogonCommands"); + + /** The actual serialized value for a SettingNames instance. */ + private final String value; + + SettingNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SettingNames instance. + * + * @param value the serialized value to parse. + * @return the parsed SettingNames object, or null if unable to parse. + */ + @JsonCreator + public static SettingNames fromString(String value) { + SettingNames[] items = SettingNames.values(); + for (SettingNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ShareInfoElement.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ShareInfoElement.java new file mode 100644 index 0000000000000..12d00ce6e2a41 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ShareInfoElement.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ShareInfoElement model. */ +@Immutable +public final class ShareInfoElement { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ShareInfoElement.class); + + /* + * A relative URI containing the ID of the VM that has the disk attached. + */ + @JsonProperty(value = "vmUri", access = JsonProperty.Access.WRITE_ONLY) + private String vmUri; + + /** + * Get the vmUri property: A relative URI containing the ID of the VM that has the disk attached. + * + * @return the vmUri value. + */ + public String vmUri() { + return this.vmUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleries.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleries.java new file mode 100644 index 0000000000000..17c12326113c6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleries.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 SharedGalleries. */ +public interface SharedGalleries { + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + PagedIterable list(String location); + + /** + * List shared galleries by subscription id or tenant id. + * + * @param location Resource location. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Galleries operation response. + */ + PagedIterable list(String location, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + SharedGallery get(String location, String galleryUniqueName); + + /** + * Get a shared gallery by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery by subscription id or tenant id. + */ + Response getWithResponse(String location, String galleryUniqueName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGallery.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGallery.java new file mode 100644 index 0000000000000..353141bd2a243 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGallery.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; + +/** An immutable client-side representation of SharedGallery. */ +public interface SharedGallery { + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the uniqueId property: The unique id of this shared gallery. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner object. + * + * @return the inner object. + */ + SharedGalleryInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImage.java new file mode 100644 index 0000000000000..9b7113688f55b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImage.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of SharedGalleryImage. */ +public interface SharedGalleryImage { + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the uniqueId property: The unique id of this shared gallery. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the osType property: This property allows you to specify the type of the OS that is included in the disk + * when creating a VM from a managed image. <br><br> Possible values are: <br><br> + * **Windows** <br><br> **Linux**. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the osState property: This property allows the user to specify whether the virtual machines created under + * this image are 'Generalized' or 'Specialized'. + * + * @return the osState value. + */ + OperatingSystemStateTypes osState(); + + /** + * Gets the endOfLifeDate property: The end of life date of the gallery image definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + OffsetDateTime endOfLifeDate(); + + /** + * Gets the identifier property: This is the gallery image definition identifier. + * + * @return the identifier value. + */ + GalleryImageIdentifier identifier(); + + /** + * Gets the recommended property: The properties describe the recommended machine configuration for this Image + * Definition. These properties are updatable. + * + * @return the recommended value. + */ + RecommendedMachineConfiguration recommended(); + + /** + * Gets the disallowed property: Describes the disallowed disk types. + * + * @return the disallowed value. + */ + Disallowed disallowed(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the features property: A list of gallery image features. + * + * @return the features value. + */ + List features(); + + /** + * Gets the purchasePlan property: Describes the gallery image definition purchase plan. This is used by marketplace + * images. + * + * @return the purchasePlan value. + */ + ImagePurchasePlan purchasePlan(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner object. + * + * @return the inner object. + */ + SharedGalleryImageInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageList.java new file mode 100644 index 0000000000000..a08a6a3a13c82 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Gallery Images operation response. */ +@Fluent +public final class SharedGalleryImageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImageList.class); + + /* + * A list of shared gallery images. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of shared gallery images. Call ListNext() + * with this to fetch the next page of shared gallery images. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of shared gallery images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of shared gallery images. + * + * @param value the value value to set. + * @return the SharedGalleryImageList object itself. + */ + public SharedGalleryImageList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of shared gallery images. Call ListNext() with this to + * fetch the next page of shared gallery images. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of shared gallery images. Call ListNext() with this to + * fetch the next page of shared gallery images. + * + * @param nextLink the nextLink value to set. + * @return the SharedGalleryImageList object itself. + */ + public SharedGalleryImageList 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 SharedGalleryImageList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersion.java new file mode 100644 index 0000000000000..1fb5d86e6553f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersion.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SharedGalleryImageVersion. */ +public interface SharedGalleryImageVersion { + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the uniqueId property: The unique id of this shared gallery. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the publishedDate property: The published date of the gallery image version Definition. This property can be + * used for decommissioning purposes. This property is updatable. + * + * @return the publishedDate value. + */ + OffsetDateTime publishedDate(); + + /** + * Gets the endOfLifeDate property: The end of life date of the gallery image version Definition. This property can + * be used for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + OffsetDateTime endOfLifeDate(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner object. + * + * @return the inner object. + */ + SharedGalleryImageVersionInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionList.java new file mode 100644 index 0000000000000..ee9e83d320d66 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersionList.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryImageVersionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Gallery Image versions operation response. */ +@Fluent +public final class SharedGalleryImageVersionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryImageVersionList.class); + + /* + * A list of shared gallery images versions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of shared gallery image versions. Call + * ListNext() with this to fetch the next page of shared gallery image + * versions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of shared gallery images versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of shared gallery images versions. + * + * @param value the value value to set. + * @return the SharedGalleryImageVersionList object itself. + */ + public SharedGalleryImageVersionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of shared gallery image versions. Call ListNext() with + * this to fetch the next page of shared gallery image versions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of shared gallery image versions. Call ListNext() with + * this to fetch the next page of shared gallery image versions. + * + * @param nextLink the nextLink value to set. + * @return the SharedGalleryImageVersionList object itself. + */ + public SharedGalleryImageVersionList 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 SharedGalleryImageVersionList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersions.java new file mode 100644 index 0000000000000..85e8ad4970183 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImageVersions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 SharedGalleryImageVersions. */ +public interface SharedGalleryImageVersions { + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + PagedIterable list(String location, String galleryUniqueName, String galleryImageName); + + /** + * List shared gallery image versions by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Image versions operation response. + */ + PagedIterable list( + String location, String galleryUniqueName, String galleryImageName, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + SharedGalleryImageVersion get( + String location, String galleryUniqueName, String galleryImageName, String galleryImageVersionName); + + /** + * Get a shared gallery image version by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image version by subscription id or tenant id. + */ + Response getWithResponse( + String location, + String galleryUniqueName, + String galleryImageName, + String galleryImageVersionName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImages.java new file mode 100644 index 0000000000000..0bebed63e907e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryImages.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 SharedGalleryImages. */ +public interface SharedGalleryImages { + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + PagedIterable list(String location, String galleryUniqueName); + + /** + * List shared gallery images by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param sharedTo The query parameter to decide what shared galleries to fetch when doing listing operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Shared Gallery Images operation response. + */ + PagedIterable list( + String location, String galleryUniqueName, SharedToValues sharedTo, Context context); + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + SharedGalleryImage get(String location, String galleryUniqueName, String galleryImageName); + + /** + * Get a shared gallery image by subscription id or tenant id. + * + * @param location Resource location. + * @param galleryUniqueName The unique name of the Shared Gallery. + * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image Versions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a shared gallery image by subscription id or tenant id. + */ + Response getWithResponse( + String location, String galleryUniqueName, String galleryImageName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryList.java new file mode 100644 index 0000000000000..86dc5d6ac9d03 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedGalleryList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.SharedGalleryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Shared Galleries operation response. */ +@Fluent +public final class SharedGalleryList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryList.class); + + /* + * A list of shared galleries. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of shared galleries. Call ListNext() with + * this to fetch the next page of shared galleries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of shared galleries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of shared galleries. + * + * @param value the value value to set. + * @return the SharedGalleryList object itself. + */ + public SharedGalleryList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch + * the next page of shared galleries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch + * the next page of shared galleries. + * + * @param nextLink the nextLink value to set. + * @return the SharedGalleryList object itself. + */ + public SharedGalleryList 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 SharedGalleryList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedToValues.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedToValues.java new file mode 100644 index 0000000000000..391951917ddf1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharedToValues.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SharedToValues. */ +public final class SharedToValues extends ExpandableStringEnum { + /** Static value tenant for SharedToValues. */ + public static final SharedToValues TENANT = fromString("tenant"); + + /** + * Creates or finds a SharedToValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharedToValues. + */ + @JsonCreator + public static SharedToValues fromString(String name) { + return fromString(name, SharedToValues.class); + } + + /** @return known SharedToValues values. */ + public static Collection values() { + return values(SharedToValues.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfile.java new file mode 100644 index 0000000000000..b509c60ce26a7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile for gallery sharing to subscription or tenant. */ +@Fluent +public final class SharingProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharingProfile.class); + + /* + * This property allows you to specify the permission of sharing gallery. + *

    Possible values are:

    **Private**

    **Groups** + */ + @JsonProperty(value = "permissions") + private GallerySharingPermissionTypes permissions; + + /* + * A list of sharing profile groups. + */ + @JsonProperty(value = "groups", access = JsonProperty.Access.WRITE_ONLY) + private List groups; + + /** + * Get the permissions property: This property allows you to specify the permission of sharing gallery. + * <br><br> Possible values are: <br><br> **Private** <br><br> **Groups**. + * + * @return the permissions value. + */ + public GallerySharingPermissionTypes permissions() { + return this.permissions; + } + + /** + * Set the permissions property: This property allows you to specify the permission of sharing gallery. + * <br><br> Possible values are: <br><br> **Private** <br><br> **Groups**. + * + * @param permissions the permissions value to set. + * @return the SharingProfile object itself. + */ + public SharingProfile withPermissions(GallerySharingPermissionTypes permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the groups property: A list of sharing profile groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroup.java new file mode 100644 index 0000000000000..c54cff599048b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroup.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Group of the gallery sharing profile. */ +@Fluent +public final class SharingProfileGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharingProfileGroup.class); + + /* + * This property allows you to specify the type of sharing group.

    + * Possible values are:

    **Subscriptions**

    **AADTenants** + */ + @JsonProperty(value = "type") + private SharingProfileGroupTypes type; + + /* + * A list of subscription/tenant ids the gallery is aimed to be shared to. + */ + @JsonProperty(value = "ids") + private List ids; + + /** + * Get the type property: This property allows you to specify the type of sharing group. <br><br> + * Possible values are: <br><br> **Subscriptions** <br><br> **AADTenants**. + * + * @return the type value. + */ + public SharingProfileGroupTypes type() { + return this.type; + } + + /** + * Set the type property: This property allows you to specify the type of sharing group. <br><br> + * Possible values are: <br><br> **Subscriptions** <br><br> **AADTenants**. + * + * @param type the type value to set. + * @return the SharingProfileGroup object itself. + */ + public SharingProfileGroup withType(SharingProfileGroupTypes type) { + this.type = type; + return this; + } + + /** + * Get the ids property: A list of subscription/tenant ids the gallery is aimed to be shared to. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: A list of subscription/tenant ids the gallery is aimed to be shared to. + * + * @param ids the ids value to set. + * @return the SharingProfileGroup object itself. + */ + public SharingProfileGroup withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroupTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroupTypes.java new file mode 100644 index 0000000000000..687134aed5260 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingProfileGroupTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SharingProfileGroupTypes. */ +public final class SharingProfileGroupTypes extends ExpandableStringEnum { + /** Static value Subscriptions for SharingProfileGroupTypes. */ + public static final SharingProfileGroupTypes SUBSCRIPTIONS = fromString("Subscriptions"); + + /** Static value AADTenants for SharingProfileGroupTypes. */ + public static final SharingProfileGroupTypes AADTENANTS = fromString("AADTenants"); + + /** + * Creates or finds a SharingProfileGroupTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharingProfileGroupTypes. + */ + @JsonCreator + public static SharingProfileGroupTypes fromString(String name) { + return fromString(name, SharingProfileGroupTypes.class); + } + + /** @return known SharingProfileGroupTypes values. */ + public static Collection values() { + return values(SharingProfileGroupTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdate.java new file mode 100644 index 0000000000000..aa7adacfa2682 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdate.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner; +import java.util.List; + +/** An immutable client-side representation of SharingUpdate. */ +public interface SharingUpdate { + /** + * Gets the operationType property: This property allows you to specify the operation type of gallery sharing + * update. <br><br> Possible values are: <br><br> **Add** <br><br> **Remove** + * <br><br> **Reset**. + * + * @return the operationType value. + */ + SharingUpdateOperationTypes operationType(); + + /** + * Gets the groups property: A list of sharing profile groups. + * + * @return the groups value. + */ + List groups(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner object. + * + * @return the inner object. + */ + SharingUpdateInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdateOperationTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdateOperationTypes.java new file mode 100644 index 0000000000000..3340e206f19c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SharingUpdateOperationTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SharingUpdateOperationTypes. */ +public final class SharingUpdateOperationTypes extends ExpandableStringEnum { + /** Static value Add for SharingUpdateOperationTypes. */ + public static final SharingUpdateOperationTypes ADD = fromString("Add"); + + /** Static value Remove for SharingUpdateOperationTypes. */ + public static final SharingUpdateOperationTypes REMOVE = fromString("Remove"); + + /** Static value Reset for SharingUpdateOperationTypes. */ + public static final SharingUpdateOperationTypes RESET = fromString("Reset"); + + /** + * Creates or finds a SharingUpdateOperationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharingUpdateOperationTypes. + */ + @JsonCreator + public static SharingUpdateOperationTypes fromString(String name) { + return fromString(name, SharingUpdateOperationTypes.class); + } + + /** @return known SharingUpdateOperationTypes values. */ + public static Collection values() { + return values(SharingUpdateOperationTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Sku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Sku.java new file mode 100644 index 0000000000000..71ef7676010ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Sku.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is + * currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. + */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The sku name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the tier of virtual machines in a scale set.

    + * Possible Values:

    **Standard**

    **Basic** + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Specifies the number of virtual machines in the scale set. + */ + @JsonProperty(value = "capacity") + private Long capacity; + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The sku name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + public Long capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Specifies the number of virtual machines in the scale set. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java new file mode 100644 index 0000000000000..d5d076f8b3335 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java @@ -0,0 +1,651 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of Snapshot. */ +public interface Snapshot { + /** + * 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 managedBy property: Unused. Always Null. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an + * optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * + * @return the sku value. + */ + SnapshotSku sku(); + + /** + * Gets the extendedLocation property: The extended location where the snapshot will be created. Extended location + * cannot be changed. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the timeCreated property: The time when the snapshot was created. + * + * @return the timeCreated value. + */ + OffsetDateTime timeCreated(); + + /** + * Gets the osType property: The Operating System type. + * + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks + * only. + * + * @return the hyperVGeneration value. + */ + HyperVGeneration hyperVGeneration(); + + /** + * Gets the purchasePlan property: Purchase plan information for the image from which the source disk for the + * snapshot was originally created. + * + * @return the purchasePlan value. + */ + PurchasePlanAutoGenerated purchasePlan(); + + /** + * Gets the creationData property: Disk source information. CreationData information cannot be changed after the + * disk has been created. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + Integer diskSizeGB(); + + /** + * Gets the diskSizeBytes property: The size of the disk in bytes. This field is read only. + * + * @return the diskSizeBytes value. + */ + Long diskSizeBytes(); + + /** + * Gets the diskState property: The state of the snapshot. + * + * @return the diskState value. + */ + DiskState diskState(); + + /** + * Gets the uniqueId property: Unique Guid identifying the resource. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + EncryptionSettingsCollection encryptionSettingsCollection(); + + /** + * Gets the provisioningState property: The disk provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy + * less space than full snapshots and can be diffed. + * + * @return the incremental value. + */ + Boolean incremental(); + + /** + * Gets the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + NetworkAccessPolicy networkAccessPolicy(); + + /** + * Gets the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + String diskAccessId(); + + /** + * Gets the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + Boolean supportsHibernation(); + + /** + * 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.compute.generated.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** The entirety of the Snapshot definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Snapshot definition stages. */ + interface DefinitionStages { + /** The first stage of the Snapshot definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Snapshot 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 Snapshot definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Snapshot 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.WithSku, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithOsType, + DefinitionStages.WithHyperVGeneration, + DefinitionStages.WithPurchasePlan, + DefinitionStages.WithCreationData, + DefinitionStages.WithDiskSizeGB, + DefinitionStages.WithEncryptionSettingsCollection, + DefinitionStages.WithIncremental, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkAccessPolicy, + DefinitionStages.WithDiskAccessId, + DefinitionStages.WithSupportsHibernation { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + /** The stage of the Snapshot 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 Snapshot definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + * This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to + * the same sku as the previous snapshot. + * + * @param sku The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional + * parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * @return the next definition stage. + */ + WithCreate withSku(SnapshotSku sku); + } + /** The stage of the Snapshot definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location where the snapshot will be created. + * Extended location cannot be changed.. + * + * @param extendedLocation The extended location where the snapshot will be created. Extended location + * cannot be changed. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Snapshot definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The Operating System type.. + * + * @param osType The Operating System type. + * @return the next definition stage. + */ + WithCreate withOsType(OperatingSystemTypes osType); + } + /** The stage of the Snapshot definition allowing to specify hyperVGeneration. */ + interface WithHyperVGeneration { + /** + * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to + * OS disks only.. + * + * @param hyperVGeneration The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + * @return the next definition stage. + */ + WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration); + } + /** The stage of the Snapshot definition allowing to specify purchasePlan. */ + interface WithPurchasePlan { + /** + * Specifies the purchasePlan property: Purchase plan information for the image from which the source disk + * for the snapshot was originally created.. + * + * @param purchasePlan Purchase plan information for the image from which the source disk for the snapshot + * was originally created. + * @return the next definition stage. + */ + WithCreate withPurchasePlan(PurchasePlanAutoGenerated purchasePlan); + } + /** The stage of the Snapshot definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: Disk source information. CreationData information cannot be changed + * after the disk has been created.. + * + * @param creationData Disk source information. CreationData information cannot be changed after the disk + * has been created. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the Snapshot definition allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + WithCreate withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Snapshot definition allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Snapshot definition allowing to specify incremental. */ + interface WithIncremental { + /** + * Specifies the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same + * disk occupy less space than full snapshots and can be diffed.. + * + * @param incremental Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less + * space than full snapshots and can be diffed. + * @return the next definition stage. + */ + WithCreate withIncremental(Boolean incremental); + } + /** The stage of the Snapshot definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the Snapshot definition allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + WithCreate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Snapshot definition allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + WithCreate withDiskAccessId(String diskAccessId); + } + /** The stage of the Snapshot definition allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a snapshot supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a snapshot supports hibernation. + * @return the next definition stage. + */ + WithCreate withSupportsHibernation(Boolean supportsHibernation); + } + } + /** + * Begins update for the Snapshot resource. + * + * @return the stage of resource update. + */ + Snapshot.Update update(); + + /** The template for Snapshot update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithOsType, + UpdateStages.WithDiskSizeGB, + UpdateStages.WithEncryptionSettingsCollection, + UpdateStages.WithEncryption, + UpdateStages.WithNetworkAccessPolicy, + UpdateStages.WithDiskAccessId, + UpdateStages.WithSupportsHibernation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Snapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Snapshot apply(Context context); + } + /** The Snapshot update stages. */ + interface UpdateStages { + /** The stage of the Snapshot 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); + } + /** The stage of the Snapshot update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + * This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to + * the same sku as the previous snapshot. + * + * @param sku The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional + * parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * @return the next definition stage. + */ + Update withSku(SnapshotSku sku); + } + /** The stage of the Snapshot update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: the Operating System type.. + * + * @param osType the Operating System type. + * @return the next definition stage. + */ + Update withOsType(OperatingSystemTypes osType); + } + /** The stage of the Snapshot update allowing to specify diskSizeGB. */ + interface WithDiskSizeGB { + /** + * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for updates or creation with other + * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and + * can only increase the disk's size.. + * + * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + * @return the next definition stage. + */ + Update withDiskSizeGB(Integer diskSizeGB); + } + /** The stage of the Snapshot update allowing to specify encryptionSettingsCollection. */ + interface WithEncryptionSettingsCollection { + /** + * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk + * Encryption, can contain multiple encryption settings per disk or snapshot.. + * + * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * @return the next definition stage. + */ + Update withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection); + } + /** The stage of the Snapshot update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys.. + * + * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or + * platform managed keys. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the Snapshot update allowing to specify networkAccessPolicy. */ + interface WithNetworkAccessPolicy { + /** + * Specifies the networkAccessPolicy property: Policy for accessing the disk via network.. + * + * @param networkAccessPolicy Policy for accessing the disk via network. + * @return the next definition stage. + */ + Update withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy); + } + /** The stage of the Snapshot update allowing to specify diskAccessId. */ + interface WithDiskAccessId { + /** + * Specifies the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on + * disks.. + * + * @param diskAccessId ARM id of the DiskAccess resource for using private endpoints on disks. + * @return the next definition stage. + */ + Update withDiskAccessId(String diskAccessId); + } + /** The stage of the Snapshot update allowing to specify supportsHibernation. */ + interface WithSupportsHibernation { + /** + * Specifies the supportsHibernation property: Indicates the OS on a snapshot supports hibernation.. + * + * @param supportsHibernation Indicates the OS on a snapshot supports hibernation. + * @return the next definition stage. + */ + Update withSupportsHibernation(Boolean supportsHibernation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); + + /** + * Grants access to a snapshot. + * + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData); + + /** + * Grants access to a snapshot. + * + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a snapshot. + * + * @throws com.azure.core.management.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 revokeAccess(); + + /** + * Revokes access to a snapshot. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java new file mode 100644 index 0000000000000..2ae652e8e6dee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Snapshots operation response. */ +@Fluent +public final class SnapshotList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotList.class); + + /* + * A list of snapshots. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of snapshots. Call ListNext() with this + * to fetch the next page of snapshots. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of snapshots. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of snapshots. + * + * @param value the value value to set. + * @return the SnapshotList object itself. + */ + public SnapshotList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the + * next page of snapshots. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the + * next page of snapshots. + * + * @param nextLink the nextLink value to set. + * @return the SnapshotList object itself. + */ + public SnapshotList 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 SnapshotList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotSku.java new file mode 100644 index 0000000000000..2f2d0e9fcc2c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotSku.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for + * incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot. + */ +@Fluent +public final class SnapshotSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotSku.class); + + /* + * The sku name. + */ + @JsonProperty(value = "name") + private SnapshotStorageAccountTypes name; + + /* + * The sku tier. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public SnapshotStorageAccountTypes name() { + return this.name; + } + + /** + * Set the name property: The sku name. + * + * @param name the name value to set. + * @return the SnapshotSku object itself. + */ + public SnapshotSku withName(SnapshotStorageAccountTypes name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotStorageAccountTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotStorageAccountTypes.java new file mode 100644 index 0000000000000..93d3d0633c33b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotStorageAccountTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SnapshotStorageAccountTypes. */ +public final class SnapshotStorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Standard_ZRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes STANDARD_ZRS = fromString("Standard_ZRS"); + + /** + * Creates or finds a SnapshotStorageAccountTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapshotStorageAccountTypes. + */ + @JsonCreator + public static SnapshotStorageAccountTypes fromString(String name) { + return fromString(name, SnapshotStorageAccountTypes.class); + } + + /** @return known SnapshotStorageAccountTypes values. */ + public static Collection values() { + return values(SnapshotStorageAccountTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.java new file mode 100644 index 0000000000000..c1797d8550a7b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Snapshot update resource. */ +@JsonFlatten +@Fluent +public class SnapshotUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or + * Standard_ZRS. This is an optional parameter for incremental snapshot and + * the default behavior is the SKU will be set to the same sku as the + * previous snapshot + */ + @JsonProperty(value = "sku") + private SnapshotSku sku; + + /* + * the Operating System type. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /* + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the disk to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /* + * Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettingsCollection") + private EncryptionSettingsCollection encryptionSettingsCollection; + + /* + * Encryption property can be used to encrypt data at rest with customer + * managed keys or platform managed keys. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * Policy for accessing the disk via network. + */ + @JsonProperty(value = "properties.networkAccessPolicy") + private NetworkAccessPolicy networkAccessPolicy; + + /* + * ARM id of the DiskAccess resource for using private endpoints on disks. + */ + @JsonProperty(value = "properties.diskAccessId") + private String diskAccessId; + + /* + * Indicates the OS on a snapshot supports hibernation. + */ + @JsonProperty(value = "properties.supportsHibernation") + private Boolean supportsHibernation; + + /** + * 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 SnapshotUpdate object itself. + */ + public SnapshotUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an + * optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * + * @return the sku value. + */ + public SnapshotSku sku() { + return this.sku; + } + + /** + * Set the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an + * optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as + * the previous snapshot. + * + * @param sku the sku value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withSku(SnapshotSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the osType property: the Operating System type. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: the Operating System type. + * + * @param osType the osType value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the + * size of the disk to create. If this field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's + * size. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @return the encryptionSettingsCollection value. + */ + public EncryptionSettingsCollection encryptionSettingsCollection() { + return this.encryptionSettingsCollection; + } + + /** + * Set the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can + * contain multiple encryption settings per disk or snapshot. + * + * @param encryptionSettingsCollection the encryptionSettingsCollection value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection) { + this.encryptionSettingsCollection = encryptionSettingsCollection; + return this; + } + + /** + * Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys + * or platform managed keys. + * + * @param encryption the encryption value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @return the networkAccessPolicy value. + */ + public NetworkAccessPolicy networkAccessPolicy() { + return this.networkAccessPolicy; + } + + /** + * Set the networkAccessPolicy property: Policy for accessing the disk via network. + * + * @param networkAccessPolicy the networkAccessPolicy value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withNetworkAccessPolicy(NetworkAccessPolicy networkAccessPolicy) { + this.networkAccessPolicy = networkAccessPolicy; + return this; + } + + /** + * Get the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @return the diskAccessId value. + */ + public String diskAccessId() { + return this.diskAccessId; + } + + /** + * Set the diskAccessId property: ARM id of the DiskAccess resource for using private endpoints on disks. + * + * @param diskAccessId the diskAccessId value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withDiskAccessId(String diskAccessId) { + this.diskAccessId = diskAccessId; + return this; + } + + /** + * Get the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @return the supportsHibernation value. + */ + public Boolean supportsHibernation() { + return this.supportsHibernation; + } + + /** + * Set the supportsHibernation property: Indicates the OS on a snapshot supports hibernation. + * + * @param supportsHibernation the supportsHibernation value to set. + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withSupportsHibernation(Boolean supportsHibernation) { + this.supportsHibernation = supportsHibernation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (encryptionSettingsCollection() != null) { + encryptionSettingsCollection().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshots.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshots.java new file mode 100644 index 0000000000000..db53f159e4ad3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshots.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 Snapshots. */ +public interface Snapshots { + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + Snapshot getByResourceGroup(String resourceGroupName, String snapshotName); + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String snapshotName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String snapshotName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 snapshotName, Context context); + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + PagedIterable list(); + + /** + * Lists snapshots under 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 List Snapshots operation response. + */ + PagedIterable list(Context context); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData); + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a disk access SAS uri. + */ + AccessUri grantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String snapshotName); + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeAccess(String resourceGroupName, String snapshotName, Context context); + + /** + * Gets information about a snapshot. + * + * @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 information about a snapshot. + */ + Snapshot getById(String id); + + /** + * Gets information about a snapshot. + * + * @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 information about a snapshot. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a snapshot. + * + * @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 snapshot. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SourceVault.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SourceVault.java new file mode 100644 index 0000000000000..154292108a468 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SourceVault.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The vault id is an Azure Resource Manager Resource id in the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + */ +@Fluent +public final class SourceVault { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceVault.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id. + * + * @param id the id value to set. + * @return the SourceVault object itself. + */ + public SourceVault 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java new file mode 100644 index 0000000000000..73f01fef70313 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SpotRestorePolicy.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Spot-Try-Restore properties for the virtual machine scale set. <br><br> With this property + * customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on + * capacity availability and pricing constraint. + */ +@Fluent +public final class SpotRestorePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpotRestorePolicy.class); + + /* + * Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances + * will be tried to be restored opportunistically based on capacity + * availability and pricing constraints + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Timeout value expressed as an ISO 8601 time duration after which the + * platform will not try to restore the VMSS SPOT instances + */ + @JsonProperty(value = "restoreTimeout") + private String restoreTimeout; + + /** + * Get the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to + * be restored opportunistically based on capacity availability and pricing constraints. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to + * be restored opportunistically based on capacity availability and pricing constraints. + * + * @param enabled the enabled value to set. + * @return the SpotRestorePolicy object itself. + */ + public SpotRestorePolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform + * will not try to restore the VMSS SPOT instances. + * + * @return the restoreTimeout value. + */ + public String restoreTimeout() { + return this.restoreTimeout; + } + + /** + * Set the restoreTimeout property: Timeout value expressed as an ISO 8601 time duration after which the platform + * will not try to restore the VMSS SPOT instances. + * + * @param restoreTimeout the restoreTimeout value to set. + * @return the SpotRestorePolicy object itself. + */ + public SpotRestorePolicy withRestoreTimeout(String restoreTimeout) { + this.restoreTimeout = restoreTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.java new file mode 100644 index 0000000000000..f07bfa55dad6a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshConfiguration.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshConfiguration.class); + + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the SshConfiguration object itself. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.java new file mode 100644 index 0000000000000..4c697e1f66170 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKey.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + */ +@Fluent +public final class SshPublicKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKey.class); + + /* + * Specifies the full path on the created VM where ssh public key is + * stored. If the file already exists, the specified key is appended to the + * file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /* + * SSH public key certificate used to authenticate with the VM through ssh. + * The key needs to be at least 2048-bit and in ssh-rsa format.

    + * For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux + * VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** + * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java new file mode 100644 index 0000000000000..b766d42705b4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyGenerateKeyPairResult.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner; + +/** An immutable client-side representation of SshPublicKeyGenerateKeyPairResult. */ +public interface SshPublicKeyGenerateKeyPairResult { + /** + * Gets the privateKey property: Private key portion of the key pair used to authenticate to a virtual machine + * through ssh. The private key is returned in RFC3447 format and should be treated as a secret. + * + * @return the privateKey value. + */ + String privateKey(); + + /** + * Gets the publicKey property: Public key portion of the key pair used to authenticate to a virtual machine through + * ssh. The public key is in ssh-rsa format. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyGenerateKeyPairResultInner + * object. + * + * @return the inner object. + */ + SshPublicKeyGenerateKeyPairResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java new file mode 100644 index 0000000000000..4644eae0c5c8d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import java.util.Map; + +/** An immutable client-side representation of SshPublicKeyResource. */ +public interface SshPublicKeyResource { + /** + * 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 publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * 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.compute.generated.fluent.models.SshPublicKeyResourceInner object. + * + * @return the inner object. + */ + SshPublicKeyResourceInner innerModel(); + + /** The entirety of the SshPublicKeyResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SshPublicKeyResource definition stages. */ + interface DefinitionStages { + /** The first stage of the SshPublicKeyResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SshPublicKeyResource 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 SshPublicKeyResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SshPublicKeyResource 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.WithPublicKey { + /** + * Executes the create request. + * + * @return the created resource. + */ + SshPublicKeyResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SshPublicKeyResource create(Context context); + } + /** The stage of the SshPublicKeyResource 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 SshPublicKeyResource definition allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. + * If this property is not initially provided when the resource is created, the publicKey property will be + * populated when generateKeyPair is called. If the public key is provided upon resource creation, the + * provided public key needs to be at least 2048-bit and in ssh-rsa format.. + * + * @param publicKey SSH public key used to authenticate to a virtual machine through ssh. If this property + * is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public + * key needs to be at least 2048-bit and in ssh-rsa format. + * @return the next definition stage. + */ + WithCreate withPublicKey(String publicKey); + } + } + /** + * Begins update for the SshPublicKeyResource resource. + * + * @return the stage of resource update. + */ + SshPublicKeyResource.Update update(); + + /** The template for SshPublicKeyResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithPublicKey { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SshPublicKeyResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SshPublicKeyResource apply(Context context); + } + /** The SshPublicKeyResource update stages. */ + interface UpdateStages { + /** The stage of the SshPublicKeyResource 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); + } + /** The stage of the SshPublicKeyResource update allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. + * If this property is not initially provided when the resource is created, the publicKey property will be + * populated when generateKeyPair is called. If the public key is provided upon resource creation, the + * provided public key needs to be at least 2048-bit and in ssh-rsa format.. + * + * @param publicKey SSH public key used to authenticate to a virtual machine through ssh. If this property + * is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public + * key needs to be at least 2048-bit and in ssh-rsa format. + * @return the next definition stage. + */ + Update withPublicKey(String publicKey); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SshPublicKeyResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SshPublicKeyResource refresh(Context context); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + SshPublicKeyGenerateKeyPairResult generateKeyPair(); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key 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 response from generation of an SSH key pair. + */ + Response generateKeyPairWithResponse(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.java new file mode 100644 index 0000000000000..8f4279f871c2c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyUpdateResource.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Specifies information about the SSH public key. */ +@JsonFlatten +@Fluent +public class SshPublicKeyUpdateResource extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeyUpdateResource.class); + + /* + * SSH public key used to authenticate to a virtual machine through ssh. If + * this property is not initially provided when the resource is created, + * the publicKey property will be populated when generateKeyPair is called. + * If the public key is provided upon resource creation, the provided + * public key needs to be at least 2048-bit and in ssh-rsa format. + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /** + * Get the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: SSH public key used to authenticate to a virtual machine through ssh. If this + * property is not initially provided when the resource is created, the publicKey property will be populated when + * generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to + * be at least 2048-bit and in ssh-rsa format. + * + * @param publicKey the publicKey value to set. + * @return the SshPublicKeyUpdateResource object itself. + */ + public SshPublicKeyUpdateResource withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** {@inheritDoc} */ + @Override + public SshPublicKeyUpdateResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java new file mode 100644 index 0000000000000..7e8dd14c3d2d9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeys.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 SshPublicKeys. */ +public interface SshPublicKeys { + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + PagedIterable list(); + + /** + * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next + * page of SSH public keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list SSH public keys operation response. + */ + PagedIterable list(Context context); + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to + * get the next page of SSH public keys. + * + * @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 the list SSH public keys operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sshPublicKeyName); + + /** + * Delete an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response deleteWithResponse(String resourceGroupName, String sshPublicKeyName, Context context); + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + SshPublicKeyResource getByResourceGroup(String resourceGroupName, String sshPublicKeyName); + + /** + * Retrieves information about an SSH public key. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the SSH public key. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + SshPublicKeyGenerateKeyPairResult generateKeyPair(String resourceGroupName, String sshPublicKeyName); + + /** + * Generates and returns a public/private key pair and populates the SSH public key resource with the public key. + * The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @param resourceGroupName The name of the resource group. + * @param sshPublicKeyName The name of the SSH public key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response from generation of an SSH key pair. + */ + Response generateKeyPairWithResponse( + String resourceGroupName, String sshPublicKeyName, Context context); + + /** + * Retrieves information about an SSH public key. + * + * @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 specifies information about the SSH public key. + */ + SshPublicKeyResource getById(String id); + + /** + * Retrieves information about an SSH public key. + * + * @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 specifies information about the SSH public key. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an SSH public key. + * + * @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); + + /** + * Delete an SSH public key. + * + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SshPublicKeyResource resource. + * + * @param name resource name. + * @return the first stage of the new SshPublicKeyResource definition. + */ + SshPublicKeyResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.java new file mode 100644 index 0000000000000..e5a939c1d7988 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeysGroupListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list SSH public keys operation response. */ +@Fluent +public final class SshPublicKeysGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKeysGroupListResult.class); + + /* + * The list of SSH public keys + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of SSH public keys. Call ListNext() with + * this URI to fetch the next page of SSH public keys. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of SSH public keys. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of SSH public keys. + * + * @param value the value value to set. + * @return the SshPublicKeysGroupListResult object itself. + */ + public SshPublicKeysGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to + * fetch the next page of SSH public keys. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to + * fetch the next page of SSH public keys. + * + * @param nextLink the nextLink value to set. + * @return the SshPublicKeysGroupListResult object itself. + */ + public SshPublicKeysGroupListResult 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 SshPublicKeysGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.java new file mode 100644 index 0000000000000..ff988dbf9fcf8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusCodeCount.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StatusCodeCount model. */ +@Immutable +public final class StatusCodeCount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatusCodeCount.class); + + /* + * The instance view status code + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Number of instances having this status code + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** + * Get the code property: The instance view status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the count property: Number of instances having this status code. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.java new file mode 100644 index 0000000000000..4f39b73d0445a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StatusLevelTypes.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for StatusLevelTypes. */ +public enum StatusLevelTypes { + /** Enum value Info. */ + INFO("Info"), + + /** Enum value Warning. */ + WARNING("Warning"), + + /** Enum value Error. */ + ERROR("Error"); + + /** The actual serialized value for a StatusLevelTypes instance. */ + private final String value; + + StatusLevelTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StatusLevelTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed StatusLevelTypes object, or null if unable to parse. + */ + @JsonCreator + public static StatusLevelTypes fromString(String value) { + StatusLevelTypes[] items = StatusLevelTypes.values(); + for (StatusLevelTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.java new file mode 100644 index 0000000000000..4ae5b590c172c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAccountType. */ +public final class StorageAccountType extends ExpandableStringEnum { + /** Static value Standard_LRS for StorageAccountType. */ + public static final StorageAccountType STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Standard_ZRS for StorageAccountType. */ + public static final StorageAccountType STANDARD_ZRS = fromString("Standard_ZRS"); + + /** Static value Premium_LRS for StorageAccountType. */ + public static final StorageAccountType PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Creates or finds a StorageAccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountType. + */ + @JsonCreator + public static StorageAccountType fromString(String name) { + return fromString(name, StorageAccountType.class); + } + + /** @return known StorageAccountType values. */ + public static Collection values() { + return values(StorageAccountType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.java new file mode 100644 index 0000000000000..ada14caf138a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAccountTypes. */ +public final class StorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** Static value UltraSSD_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** Static value Premium_ZRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value StandardSSD_ZRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** + * Creates or finds a StorageAccountTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountTypes. + */ + @JsonCreator + public static StorageAccountTypes fromString(String name) { + return fromString(name, StorageAccountTypes.class); + } + + /** @return known StorageAccountTypes values. */ + public static Collection values() { + return values(StorageAccountTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.java new file mode 100644 index 0000000000000..e1db0824339b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageProfile.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the storage settings for the virtual machine disks. */ +@Fluent +public final class StorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); + + /* + * Specifies information about the image to use. You can specify + * information about platform images, marketplace images, or virtual + * machine images. This element is required when you want to use a platform + * image, marketplace image, or virtual machine image, but is not used in + * other creation operations. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the + * virtual machine.

    For more information about disks, see [About + * disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private OSDisk osDisk; + + /* + * Specifies the parameters that are used to add a data disk to a virtual + * machine.

    For more information about disks, see [About disks and + * VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @param imageReference the imageReference value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public OSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withOsDisk(OSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add a data disk to a virtual machine. + * <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceReadOnly.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceReadOnly.java new file mode 100644 index 0000000000000..ad682b3f53ea9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceReadOnly.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SubResourceReadOnly model. */ +@Immutable +public class SubResourceReadOnly { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubResourceReadOnly.class); + + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.java new file mode 100644 index 0000000000000..88d1327313ff1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SubResourceWithColocationStatus.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SubResourceWithColocationStatus model. */ +@Fluent +public final class SubResourceWithColocationStatus extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubResourceWithColocationStatus.class); + + /* + * Describes colocation status of a resource in the Proximity Placement + * Group. + */ + @JsonProperty(value = "colocationStatus") + private InstanceViewStatus colocationStatus; + + /** + * Get the colocationStatus property: Describes colocation status of a resource in the Proximity Placement Group. + * + * @return the colocationStatus value. + */ + public InstanceViewStatus colocationStatus() { + return this.colocationStatus; + } + + /** + * Set the colocationStatus property: Describes colocation status of a resource in the Proximity Placement Group. + * + * @param colocationStatus the colocationStatus value to set. + * @return the SubResourceWithColocationStatus object itself. + */ + public SubResourceWithColocationStatus withColocationStatus(InstanceViewStatus colocationStatus) { + this.colocationStatus = colocationStatus; + return this; + } + + /** {@inheritDoc} */ + @Override + public SubResourceWithColocationStatus withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (colocationStatus() != null) { + colocationStatus().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.java new file mode 100644 index 0000000000000..9e5ecd680a0d0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TargetRegion.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the target region information. */ +@Fluent +public final class TargetRegion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetRegion.class); + + /* + * The name of the region. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The number of replicas of the Image Version to be created per region. + * This property is updatable. + */ + @JsonProperty(value = "regionalReplicaCount") + private Integer regionalReplicaCount; + + /* + * Specifies the storage account type to be used to store the image. This + * property is not updatable. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountType storageAccountType; + + /* + * Optional. Allows users to provide customer managed keys for encrypting + * the OS and data disks in the gallery artifact. + */ + @JsonProperty(value = "encryption") + private EncryptionImages encryption; + + /** + * Get the name property: The name of the region. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the region. + * + * @param name the name value to set. + * @return the TargetRegion object itself. + */ + public TargetRegion withName(String name) { + this.name = name; + return this; + } + + /** + * Get the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This + * property is updatable. + * + * @return the regionalReplicaCount value. + */ + public Integer regionalReplicaCount() { + return this.regionalReplicaCount; + } + + /** + * Set the regionalReplicaCount property: The number of replicas of the Image Version to be created per region. This + * property is updatable. + * + * @param regionalReplicaCount the regionalReplicaCount value to set. + * @return the TargetRegion object itself. + */ + public TargetRegion withRegionalReplicaCount(Integer regionalReplicaCount) { + this.regionalReplicaCount = regionalReplicaCount; + return this; + } + + /** + * Get the storageAccountType property: Specifies the storage account type to be used to store the image. This + * property is not updatable. + * + * @return the storageAccountType value. + */ + public StorageAccountType storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type to be used to store the image. This + * property is not updatable. + * + * @param storageAccountType the storageAccountType value to set. + * @return the TargetRegion object itself. + */ + public TargetRegion withStorageAccountType(StorageAccountType storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the encryption property: Optional. Allows users to provide customer managed keys for encrypting the OS and + * data disks in the gallery artifact. + * + * @return the encryption value. + */ + public EncryptionImages encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Optional. Allows users to provide customer managed keys for encrypting the OS and + * data disks in the gallery artifact. + * + * @param encryption the encryption value to set. + * @return the TargetRegion object itself. + */ + public TargetRegion withEncryption(EncryptionImages encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model TargetRegion")); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.java new file mode 100644 index 0000000000000..fa34b426afe9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/TerminateNotificationProfile.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TerminateNotificationProfile model. */ +@Fluent +public final class TerminateNotificationProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TerminateNotificationProfile.class); + + /* + * Configurable length of time a Virtual Machine being deleted will have to + * potentially approve the Terminate Scheduled Event before the event is + * auto approved (timed out). The configuration must be specified in ISO + * 8601 format, the default value is 5 minutes (PT5M) + */ + @JsonProperty(value = "notBeforeTimeout") + private String notBeforeTimeout; + + /* + * Specifies whether the Terminate Scheduled event is enabled or disabled. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /** + * Get the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to + * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The + * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). + * + * @return the notBeforeTimeout value. + */ + public String notBeforeTimeout() { + return this.notBeforeTimeout; + } + + /** + * Set the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to + * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The + * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). + * + * @param notBeforeTimeout the notBeforeTimeout value to set. + * @return the TerminateNotificationProfile object itself. + */ + public TerminateNotificationProfile withNotBeforeTimeout(String notBeforeTimeout) { + this.notBeforeTimeout = notBeforeTimeout; + return this; + } + + /** + * Get the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. + * + * @param enable the enable value to set. + * @return the TerminateNotificationProfile object itself. + */ + public TerminateNotificationProfile withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java new file mode 100644 index 0000000000000..36889b0337823 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ThrottledRequestsInput.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; + +/** Api request input for LogAnalytics getThrottledRequests Api. */ +@Fluent +public final class ThrottledRequestsInput extends LogAnalyticsInputBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ThrottledRequestsInput.class); + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withBlobContainerSasUri(String blobContainerSasUri) { + super.withBlobContainerSasUri(blobContainerSasUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withFromTime(OffsetDateTime fromTime) { + super.withFromTime(fromTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withToTime(OffsetDateTime toTime) { + super.withToTime(toTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { + super.withGroupByThrottlePolicy(groupByThrottlePolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withGroupByOperationName(Boolean groupByOperationName) { + super.withGroupByOperationName(groupByOperationName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withGroupByResourceName(Boolean groupByResourceName) { + super.withGroupByResourceName(groupByResourceName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withGroupByClientApplicationId(Boolean groupByClientApplicationId) { + super.withGroupByClientApplicationId(groupByClientApplicationId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ThrottledRequestsInput withGroupByUserAgent(Boolean groupByUserAgent) { + super.withGroupByUserAgent(groupByUserAgent); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.java new file mode 100644 index 0000000000000..16b75d3f98ac6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UefiSettings.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. + * <br><br>Minimum api-version: 2020-12-01. + */ +@Fluent +public final class UefiSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UefiSettings.class); + + /* + * Specifies whether secure boot should be enabled on the virtual machine. + *

    Minimum api-version: 2020-12-01 + */ + @JsonProperty(value = "secureBootEnabled") + private Boolean secureBootEnabled; + + /* + * Specifies whether vTPM should be enabled on the virtual machine. + *

    Minimum api-version: 2020-12-01 + */ + @JsonProperty(value = "vTpmEnabled") + private Boolean vTpmEnabled; + + /** + * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * <br><br>Minimum api-version: 2020-12-01. + * + * @return the secureBootEnabled value. + */ + public Boolean secureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * <br><br>Minimum api-version: 2020-12-01. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the UefiSettings object itself. + */ + public UefiSettings withSecureBootEnabled(Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Get the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. + * <br><br>Minimum api-version: 2020-12-01. + * + * @return the vTpmEnabled value. + */ + public Boolean vTpmEnabled() { + return this.vTpmEnabled; + } + + /** + * Set the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. + * <br><br>Minimum api-version: 2020-12-01. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the UefiSettings object itself. + */ + public UefiSettings withVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java new file mode 100644 index 0000000000000..cde640c51f4d5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomain.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; + +/** An immutable client-side representation of UpdateDomain. */ +public interface UpdateDomain { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner object. + * + * @return the inner object. + */ + UpdateDomainInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java new file mode 100644 index 0000000000000..467192bebed33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateDomainListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The UpdateDomainListResult model. */ +@Fluent +public final class UpdateDomainListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDomainListResult.class); + + /* + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the UpdateDomainListResult object itself. + */ + public UpdateDomainListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the UpdateDomainListResult object itself. + */ + public UpdateDomainListResult 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 UpdateDomainListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.java new file mode 100644 index 0000000000000..fccfb0db4b612 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResource.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Update Resource model definition. */ +@Fluent +public class UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateResource.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 UpdateResource object itself. + */ + public UpdateResource 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.java new file mode 100644 index 0000000000000..7f8b66bc70697 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpdateResourceDefinition.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Update Resource model definition. */ +@Fluent +public class UpdateResourceDefinition extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateResourceDefinition.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 UpdateResourceDefinition object itself. + */ + public UpdateResourceDefinition 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.java new file mode 100644 index 0000000000000..85463733f4969 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeMode.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UpgradeMode. */ +public enum UpgradeMode { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value Manual. */ + MANUAL("Manual"), + + /** Enum value Rolling. */ + ROLLING("Rolling"); + + /** The actual serialized value for a UpgradeMode instance. */ + private final String value; + + UpgradeMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpgradeMode instance. + * + * @param value the serialized value to parse. + * @return the parsed UpgradeMode object, or null if unable to parse. + */ + @JsonCreator + public static UpgradeMode fromString(String value) { + UpgradeMode[] items = UpgradeMode.values(); + for (UpgradeMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfo.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfo.java new file mode 100644 index 0000000000000..519634a9b0715 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfo.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; + +/** An immutable client-side representation of UpgradeOperationHistoricalStatusInfo. */ +public interface UpgradeOperationHistoricalStatusInfo { + /** + * Gets the properties property: Information about the properties of the upgrade operation. + * + * @return the properties value. + */ + UpgradeOperationHistoricalStatusInfoProperties properties(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the inner + * com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner object. + * + * @return the inner object. + */ + UpgradeOperationHistoricalStatusInfoInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java new file mode 100644 index 0000000000000..c8448bd0692f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoricalStatusInfoProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes each OS upgrade on the Virtual Machine Scale Set. */ +@Immutable +public final class UpgradeOperationHistoricalStatusInfoProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoricalStatusInfoProperties.class); + + /* + * Information about the overall status of the upgrade operation. + */ + @JsonProperty(value = "runningStatus", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationHistoryStatus runningStatus; + + /* + * Counts of the VMs in each state. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeProgressInfo progress; + + /* + * Error Details for this upgrade if there are any. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /* + * Invoker of the Upgrade Operation + */ + @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationInvoker startedBy; + + /* + * Image Reference details + */ + @JsonProperty(value = "targetImageReference", access = JsonProperty.Access.WRITE_ONLY) + private ImageReference targetImageReference; + + /* + * Information about OS rollback if performed + */ + @JsonProperty(value = "rollbackInfo", access = JsonProperty.Access.WRITE_ONLY) + private RollbackStatusInfo rollbackInfo; + + /** + * Get the runningStatus property: Information about the overall status of the upgrade operation. + * + * @return the runningStatus value. + */ + public UpgradeOperationHistoryStatus runningStatus() { + return this.runningStatus; + } + + /** + * Get the progress property: Counts of the VMs in each state. + * + * @return the progress value. + */ + public RollingUpgradeProgressInfo progress() { + return this.progress; + } + + /** + * Get the error property: Error Details for this upgrade if there are any. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Get the startedBy property: Invoker of the Upgrade Operation. + * + * @return the startedBy value. + */ + public UpgradeOperationInvoker startedBy() { + return this.startedBy; + } + + /** + * Get the targetImageReference property: Image Reference details. + * + * @return the targetImageReference value. + */ + public ImageReference targetImageReference() { + return this.targetImageReference; + } + + /** + * Get the rollbackInfo property: Information about OS rollback if performed. + * + * @return the rollbackInfo value. + */ + public RollbackStatusInfo rollbackInfo() { + return this.rollbackInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (runningStatus() != null) { + runningStatus().validate(); + } + if (progress() != null) { + progress().validate(); + } + if (error() != null) { + error().validate(); + } + if (targetImageReference() != null) { + targetImageReference().validate(); + } + if (rollbackInfo() != null) { + rollbackInfo().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoryStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoryStatus.java new file mode 100644 index 0000000000000..60f4607774649 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationHistoryStatus.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about the current running state of the overall upgrade. */ +@Immutable +public final class UpgradeOperationHistoryStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeOperationHistoryStatus.class); + + /* + * Code indicating the current status of the upgrade. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeState code; + + /* + * Start time of the upgrade. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * End time of the upgrade. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /** + * Get the code property: Code indicating the current status of the upgrade. + * + * @return the code value. + */ + public UpgradeState code() { + return this.code; + } + + /** + * Get the startTime property: Start time of the upgrade. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the upgrade. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.java new file mode 100644 index 0000000000000..707571af674db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeOperationInvoker.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UpgradeOperationInvoker. */ +public enum UpgradeOperationInvoker { + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value User. */ + USER("User"), + + /** Enum value Platform. */ + PLATFORM("Platform"); + + /** The actual serialized value for a UpgradeOperationInvoker instance. */ + private final String value; + + UpgradeOperationInvoker(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpgradeOperationInvoker instance. + * + * @param value the serialized value to parse. + * @return the parsed UpgradeOperationInvoker object, or null if unable to parse. + */ + @JsonCreator + public static UpgradeOperationInvoker fromString(String value) { + UpgradeOperationInvoker[] items = UpgradeOperationInvoker.values(); + for (UpgradeOperationInvoker item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.java new file mode 100644 index 0000000000000..f669fa8af9c01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradePolicy.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an upgrade policy - automatic, manual, or rolling. */ +@Fluent +public final class UpgradePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradePolicy.class); + + /* + * Specifies the mode of an upgrade to virtual machines in the scale + * set.

    Possible values are:

    **Manual** - You + * control the application of updates to virtual machines in the scale set. + * You do this by using the manualUpgrade action.

    **Automatic** + * - All virtual machines in the scale set are automatically updated at + * the same time. + */ + @JsonProperty(value = "mode") + private UpgradeMode mode; + + /* + * The configuration parameters used while performing a rolling upgrade. + */ + @JsonProperty(value = "rollingUpgradePolicy") + private RollingUpgradePolicy rollingUpgradePolicy; + + /* + * Configuration parameters used for performing automatic OS Upgrade. + */ + @JsonProperty(value = "automaticOSUpgradePolicy") + private AutomaticOSUpgradePolicy automaticOSUpgradePolicy; + + /** + * Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br + * /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual + * machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - + * All virtual machines in the scale set are automatically updated at the same time. + * + * @return the mode value. + */ + public UpgradeMode mode() { + return this.mode; + } + + /** + * Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br + * /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual + * machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - + * All virtual machines in the scale set are automatically updated at the same time. + * + * @param mode the mode value to set. + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withMode(UpgradeMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade. + * + * @return the rollingUpgradePolicy value. + */ + public RollingUpgradePolicy rollingUpgradePolicy() { + return this.rollingUpgradePolicy; + } + + /** + * Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade. + * + * @param rollingUpgradePolicy the rollingUpgradePolicy value to set. + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy) { + this.rollingUpgradePolicy = rollingUpgradePolicy; + return this; + } + + /** + * Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. + * + * @return the automaticOSUpgradePolicy value. + */ + public AutomaticOSUpgradePolicy automaticOSUpgradePolicy() { + return this.automaticOSUpgradePolicy; + } + + /** + * Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade. + * + * @param automaticOSUpgradePolicy the automaticOSUpgradePolicy value to set. + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy) { + this.automaticOSUpgradePolicy = automaticOSUpgradePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rollingUpgradePolicy() != null) { + rollingUpgradePolicy().validate(); + } + if (automaticOSUpgradePolicy() != null) { + automaticOSUpgradePolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.java new file mode 100644 index 0000000000000..da6df9be090c4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UpgradeState.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.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UpgradeState. */ +public enum UpgradeState { + /** Enum value RollingForward. */ + ROLLING_FORWARD("RollingForward"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Faulted. */ + FAULTED("Faulted"); + + /** The actual serialized value for a UpgradeState instance. */ + private final String value; + + UpgradeState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpgradeState instance. + * + * @param value the serialized value to parse. + * @return the parsed UpgradeState object, or null if unable to parse. + */ + @JsonCreator + public static UpgradeState fromString(String value) { + UpgradeState[] items = UpgradeState.values(); + for (UpgradeState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usage.java new file mode 100644 index 0000000000000..8f5828c3804ae --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usage.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the unit property: An enum describing the unit of usage measurement. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the currentValue property: The current usage of the resource. + * + * @return the currentValue value. + */ + int currentValue(); + + /** + * Gets the limit property: The maximum permitted usage of the resource. + * + * @return the limit value. + */ + long limit(); + + /** + * Gets the name property: The name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UsageName.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UsageName.java new file mode 100644 index 0000000000000..5a923bc10431e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UsageName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Usage Names. */ +@Fluent +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * The name of the resource. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: The name of the resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The name of the resource. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: The localized name of the resource. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: The localized name of the resource. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.java new file mode 100644 index 0000000000000..8a3aafb04f10e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Usages.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + PagedIterable list(String location); + + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactManage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactManage.java new file mode 100644 index 0000000000000..7c3b3e2070886 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactManage.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserArtifactManage model. */ +@Fluent +public final class UserArtifactManage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserArtifactManage.class); + + /* + * Required. The path and arguments to install the gallery application. + * This is limited to 4096 characters. + */ + @JsonProperty(value = "install", required = true) + private String install; + + /* + * Required. The path and arguments to remove the gallery application. This + * is limited to 4096 characters. + */ + @JsonProperty(value = "remove", required = true) + private String remove; + + /* + * Optional. The path and arguments to update the gallery application. If + * not present, then update operation will invoke remove command on the + * previous version and install command on the current version of the + * gallery application. This is limited to 4096 characters. + */ + @JsonProperty(value = "update") + private String update; + + /** + * Get the install property: Required. The path and arguments to install the gallery application. This is limited to + * 4096 characters. + * + * @return the install value. + */ + public String install() { + return this.install; + } + + /** + * Set the install property: Required. The path and arguments to install the gallery application. This is limited to + * 4096 characters. + * + * @param install the install value to set. + * @return the UserArtifactManage object itself. + */ + public UserArtifactManage withInstall(String install) { + this.install = install; + return this; + } + + /** + * Get the remove property: Required. The path and arguments to remove the gallery application. This is limited to + * 4096 characters. + * + * @return the remove value. + */ + public String remove() { + return this.remove; + } + + /** + * Set the remove property: Required. The path and arguments to remove the gallery application. This is limited to + * 4096 characters. + * + * @param remove the remove value to set. + * @return the UserArtifactManage object itself. + */ + public UserArtifactManage withRemove(String remove) { + this.remove = remove; + return this; + } + + /** + * Get the update property: Optional. The path and arguments to update the gallery application. If not present, then + * update operation will invoke remove command on the previous version and install command on the current version of + * the gallery application. This is limited to 4096 characters. + * + * @return the update value. + */ + public String update() { + return this.update; + } + + /** + * Set the update property: Optional. The path and arguments to update the gallery application. If not present, then + * update operation will invoke remove command on the previous version and install command on the current version of + * the gallery application. This is limited to 4096 characters. + * + * @param update the update value to set. + * @return the UserArtifactManage object itself. + */ + public UserArtifactManage withUpdate(String update) { + this.update = update; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (install() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property install in model UserArtifactManage")); + } + if (remove() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property remove in model UserArtifactManage")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSource.java new file mode 100644 index 0000000000000..f21dd4242e11b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserArtifactSource.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The source image from which the Image Version is going to be created. */ +@Fluent +public final class UserArtifactSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserArtifactSource.class); + + /* + * Required. The mediaLink of the artifact, must be a readable storage page + * blob. + */ + @JsonProperty(value = "mediaLink", required = true) + private String mediaLink; + + /* + * Optional. The defaultConfigurationLink of the artifact, must be a + * readable storage page blob. + */ + @JsonProperty(value = "defaultConfigurationLink") + private String defaultConfigurationLink; + + /** + * Get the mediaLink property: Required. The mediaLink of the artifact, must be a readable storage page blob. + * + * @return the mediaLink value. + */ + public String mediaLink() { + return this.mediaLink; + } + + /** + * Set the mediaLink property: Required. The mediaLink of the artifact, must be a readable storage page blob. + * + * @param mediaLink the mediaLink value to set. + * @return the UserArtifactSource object itself. + */ + public UserArtifactSource withMediaLink(String mediaLink) { + this.mediaLink = mediaLink; + return this; + } + + /** + * Get the defaultConfigurationLink property: Optional. The defaultConfigurationLink of the artifact, must be a + * readable storage page blob. + * + * @return the defaultConfigurationLink value. + */ + public String defaultConfigurationLink() { + return this.defaultConfigurationLink; + } + + /** + * Set the defaultConfigurationLink property: Optional. The defaultConfigurationLink of the artifact, must be a + * readable storage page blob. + * + * @param defaultConfigurationLink the defaultConfigurationLink value to set. + * @return the UserArtifactSource object itself. + */ + public UserArtifactSource withDefaultConfigurationLink(String defaultConfigurationLink) { + this.defaultConfigurationLink = defaultConfigurationLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mediaLink() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property mediaLink in model UserArtifactSource")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserAssignedIdentitiesValue.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..24ec31e85ce72 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/UserAssignedIdentitiesValue.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentitiesValue model. */ +@Immutable +public final class UserAssignedIdentitiesValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentitiesValue.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationLinux.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationLinux.java new file mode 100644 index 0000000000000..47e499a478e92 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationLinux.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchClassificationLinux. */ +public final class VMGuestPatchClassificationLinux extends ExpandableStringEnum { + /** Static value Critical for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux CRITICAL = fromString("Critical"); + + /** Static value Security for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux SECURITY = fromString("Security"); + + /** Static value Other for VMGuestPatchClassificationLinux. */ + public static final VMGuestPatchClassificationLinux OTHER = fromString("Other"); + + /** + * Creates or finds a VMGuestPatchClassificationLinux from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchClassificationLinux. + */ + @JsonCreator + public static VMGuestPatchClassificationLinux fromString(String name) { + return fromString(name, VMGuestPatchClassificationLinux.class); + } + + /** @return known VMGuestPatchClassificationLinux values. */ + public static Collection values() { + return values(VMGuestPatchClassificationLinux.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationWindows.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationWindows.java new file mode 100644 index 0000000000000..a33d6037ab122 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchClassificationWindows.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchClassificationWindows. */ +public final class VMGuestPatchClassificationWindows extends ExpandableStringEnum { + /** Static value Critical for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows CRITICAL = fromString("Critical"); + + /** Static value Security for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows SECURITY = fromString("Security"); + + /** Static value UpdateRollUp for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows UPDATE_ROLL_UP = fromString("UpdateRollUp"); + + /** Static value FeaturePack for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows FEATURE_PACK = fromString("FeaturePack"); + + /** Static value ServicePack for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows SERVICE_PACK = fromString("ServicePack"); + + /** Static value Definition for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows DEFINITION = fromString("Definition"); + + /** Static value Tools for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows TOOLS = fromString("Tools"); + + /** Static value Updates for VMGuestPatchClassificationWindows. */ + public static final VMGuestPatchClassificationWindows UPDATES = fromString("Updates"); + + /** + * Creates or finds a VMGuestPatchClassificationWindows from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchClassificationWindows. + */ + @JsonCreator + public static VMGuestPatchClassificationWindows fromString(String name) { + return fromString(name, VMGuestPatchClassificationWindows.class); + } + + /** @return known VMGuestPatchClassificationWindows values. */ + public static Collection values() { + return values(VMGuestPatchClassificationWindows.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootBehavior.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootBehavior.java new file mode 100644 index 0000000000000..238062dc003dd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootBehavior.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchRebootBehavior. */ +public final class VMGuestPatchRebootBehavior extends ExpandableStringEnum { + /** Static value Unknown for VMGuestPatchRebootBehavior. */ + public static final VMGuestPatchRebootBehavior UNKNOWN = fromString("Unknown"); + + /** Static value NeverReboots for VMGuestPatchRebootBehavior. */ + public static final VMGuestPatchRebootBehavior NEVER_REBOOTS = fromString("NeverReboots"); + + /** Static value AlwaysRequiresReboot for VMGuestPatchRebootBehavior. */ + public static final VMGuestPatchRebootBehavior ALWAYS_REQUIRES_REBOOT = fromString("AlwaysRequiresReboot"); + + /** Static value CanRequestReboot for VMGuestPatchRebootBehavior. */ + public static final VMGuestPatchRebootBehavior CAN_REQUEST_REBOOT = fromString("CanRequestReboot"); + + /** + * Creates or finds a VMGuestPatchRebootBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchRebootBehavior. + */ + @JsonCreator + public static VMGuestPatchRebootBehavior fromString(String name) { + return fromString(name, VMGuestPatchRebootBehavior.class); + } + + /** @return known VMGuestPatchRebootBehavior values. */ + public static Collection values() { + return values(VMGuestPatchRebootBehavior.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootSetting.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootSetting.java new file mode 100644 index 0000000000000..fa17f7be7eb8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootSetting.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchRebootSetting. */ +public final class VMGuestPatchRebootSetting extends ExpandableStringEnum { + /** Static value IfRequired for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** Static value Never for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting NEVER = fromString("Never"); + + /** Static value Always for VMGuestPatchRebootSetting. */ + public static final VMGuestPatchRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates or finds a VMGuestPatchRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchRebootSetting. + */ + @JsonCreator + public static VMGuestPatchRebootSetting fromString(String name) { + return fromString(name, VMGuestPatchRebootSetting.class); + } + + /** @return known VMGuestPatchRebootSetting values. */ + public static Collection values() { + return values(VMGuestPatchRebootSetting.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootStatus.java new file mode 100644 index 0000000000000..1e5cbe59a3ccd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMGuestPatchRebootStatus.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGuestPatchRebootStatus. */ +public final class VMGuestPatchRebootStatus extends ExpandableStringEnum { + /** Static value Unknown for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus UNKNOWN = fromString("Unknown"); + + /** Static value NotNeeded for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus NOT_NEEDED = fromString("NotNeeded"); + + /** Static value Required for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus REQUIRED = fromString("Required"); + + /** Static value Started for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus STARTED = fromString("Started"); + + /** Static value Failed for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus FAILED = fromString("Failed"); + + /** Static value Completed for VMGuestPatchRebootStatus. */ + public static final VMGuestPatchRebootStatus COMPLETED = fromString("Completed"); + + /** + * Creates or finds a VMGuestPatchRebootStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGuestPatchRebootStatus. + */ + @JsonCreator + public static VMGuestPatchRebootStatus fromString(String name) { + return fromString(name, VMGuestPatchRebootStatus.class); + } + + /** @return known VMGuestPatchRebootStatus values. */ + public static Collection values() { + return values(VMGuestPatchRebootStatus.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMScaleSetConvertToSinglePlacementGroupInput.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMScaleSetConvertToSinglePlacementGroupInput.java new file mode 100644 index 0000000000000..c2b53755f2a59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VMScaleSetConvertToSinglePlacementGroupInput.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VMScaleSetConvertToSinglePlacementGroupInput model. */ +@Fluent +public final class VMScaleSetConvertToSinglePlacementGroupInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VMScaleSetConvertToSinglePlacementGroupInput.class); + + /* + * Id of the placement group in which you want future virtual machine + * instances to be placed. To query placement group Id, please use Virtual + * Machine Scale Set VMs - Get API. If not provided, the platform will + * choose one with maximum number of virtual machine instances. + */ + @JsonProperty(value = "activePlacementGroupId") + private String activePlacementGroupId; + + /** + * Get the activePlacementGroupId property: Id of the placement group in which you want future virtual machine + * instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not + * provided, the platform will choose one with maximum number of virtual machine instances. + * + * @return the activePlacementGroupId value. + */ + public String activePlacementGroupId() { + return this.activePlacementGroupId; + } + + /** + * Set the activePlacementGroupId property: Id of the placement group in which you want future virtual machine + * instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not + * provided, the platform will choose one with maximum number of virtual machine instances. + * + * @param activePlacementGroupId the activePlacementGroupId value to set. + * @return the VMScaleSetConvertToSinglePlacementGroupInput object itself. + */ + public VMScaleSetConvertToSinglePlacementGroupInput withActivePlacementGroupId(String activePlacementGroupId) { + this.activePlacementGroupId = activePlacementGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.java new file mode 100644 index 0000000000000..6900de0e9e39b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultCertificate.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. */ +@Fluent +public final class VaultCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificate.class); + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as + * a secret. For adding a secret to the Key Vault, see [Add a key or secret + * to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

    {
    + * "data":"",
    "dataType":"pfx",
    + * "password":""
    } + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /* + * For Windows VMs, specifies the certificate store on the Virtual Machine + * to which the certificate should be added. The specified certificate + * store is implicitly in the LocalMachine account.

    For Linux VMs, + * the certificate file is placed under the /var/lib/waagent directory, + * with the file name <UppercaseThumbprint>.crt for the X509 + * certificate file and <UppercaseThumbprint>.prv for private key. + * Both of these files are .pem formatted. + */ + @JsonProperty(value = "certificateStore") + private String certificateStore; + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @param certificateUrl the certificateUrl value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Get the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and + * &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files are .pem formatted. + * + * @return the certificateStore value. + */ + public String certificateStore() { + return this.certificateStore; + } + + /** + * Set the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and + * &lt;UppercaseThumbprint&gt;.prv for private key. Both of these files are .pem formatted. + * + * @param certificateStore the certificateStore value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateStore(String certificateStore) { + this.certificateStore = certificateStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.java new file mode 100644 index 0000000000000..fd78434ef6671 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VaultSecretGroup.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a set of certificates which are all in the same Key Vault. */ +@Fluent +public final class VaultSecretGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSecretGroup.class); + + /* + * The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + */ + @JsonProperty(value = "sourceVault") + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain + * certificates. + */ + @JsonProperty(value = "vaultCertificates") + private List vaultCertificates; + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultCertificates() != null) { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualHardDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualHardDisk.java new file mode 100644 index 0000000000000..f055459d7f0e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualHardDisk.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the uri of a disk. */ +@Fluent +public final class VirtualHardDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHardDisk.class); + + /* + * Specifies the virtual hard disk's uri. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Get the uri property: Specifies the virtual hard disk's uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: Specifies the virtual hard disk's uri. + * + * @param uri the uri value to set. + * @return the VirtualHardDisk object itself. + */ + public VirtualHardDisk withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java new file mode 100644 index 0000000000000..61ba0d0ddcc86 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java @@ -0,0 +1,1561 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.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 plan property: Specifies information about the marketplace image used to create the virtual machine. + * This element is only used for marketplace images. Before you can use a marketplace image from an API, you must + * enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and + * then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the resources property: The virtual machine child extension resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the identity property: The identity of the virtual machine, if configured. + * + * @return the identity value. + */ + VirtualMachineIdentity identity(); + + /** + * Gets the zones property: The virtual machine zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + HardwareProfile hardwareProfile(); + + /** + * Gets the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * Gets the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @return the additionalCapabilities value. + */ + AdditionalCapabilities additionalCapabilities(); + + /** + * Gets the osProfile property: Specifies the operating system settings used while creating the virtual machine. + * Some of the settings cannot be changed once VM is provisioned. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + SecurityProfile securityProfile(); + + /** + * Gets the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + SubResource availabilitySet(); + + /** + * Gets the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + SubResource virtualMachineScaleSet(); + + /** + * Gets the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the priority value. + */ + VirtualMachinePriorityTypes priority(); + + /** + * Gets the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + VirtualMachineEvictionPolicyTypes evictionPolicy(); + + /** + * Gets the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + BillingProfile billingProfile(); + + /** + * Gets the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + SubResource host(); + + /** + * Gets the hostGroup property: Specifies information about the dedicated host group that the virtual machine + * resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify + * both host and hostGroup properties. + * + * @return the hostGroup value. + */ + SubResource hostGroup(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + VirtualMachineInstanceView instanceView(); + + /** + * Gets the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + String licenseType(); + + /** + * Gets the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in + * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + String extensionsTimeBudget(); + + /** + * Gets the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual + * Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that + * best maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + ScheduledEventsProfile scheduledEventsProfile(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + CapacityReservationProfile capacityReservation(); + + /** + * 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.compute.generated.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.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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * 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.WithPlan, + DefinitionStages.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithHardwareProfile, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithAdditionalCapabilities, + DefinitionStages.WithOsProfile, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithDiagnosticsProfile, + DefinitionStages.WithAvailabilitySet, + DefinitionStages.WithVirtualMachineScaleSet, + DefinitionStages.WithProximityPlacementGroup, + DefinitionStages.WithPriority, + DefinitionStages.WithEvictionPolicy, + DefinitionStages.WithBillingProfile, + DefinitionStages.WithHost, + DefinitionStages.WithHostGroup, + DefinitionStages.WithLicenseType, + DefinitionStages.WithExtensionsTimeBudget, + DefinitionStages.WithPlatformFaultDomain, + DefinitionStages.WithScheduledEventsProfile, + DefinitionStages.WithUserData, + DefinitionStages.WithCapacityReservation { + /** + * 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 plan. */ + interface WithPlan { + /** + * Specifies the plan property: Specifies information about the marketplace image used to create the virtual + * machine. This element is only used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that + * you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**.. + * + * @param plan Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the marketplace image that you + * want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + /** The stage of the VirtualMachine definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the virtual machine, if configured.. + * + * @param identity The identity of the virtual machine, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(VirtualMachineIdentity identity); + } + /** The stage of the VirtualMachine definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The virtual machine zones.. + * + * @param zones The virtual machine zones. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the VirtualMachine definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Virtual Machine.. + * + * @param extendedLocation The extended location of the Virtual Machine. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualMachine definition allowing to specify hardwareProfile. */ + interface WithHardwareProfile { + /** + * Specifies the hardwareProfile property: Specifies the hardware settings for the virtual machine.. + * + * @param hardwareProfile Specifies the hardware settings for the virtual machine. + * @return the next definition stage. + */ + WithCreate withHardwareProfile(HardwareProfile hardwareProfile); + } + /** The stage of the VirtualMachine definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + WithCreate withStorageProfile(StorageProfile storageProfile); + } + /** The stage of the VirtualMachine definition allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Specifies additional capabilities enabled or disabled on + * the virtual machine.. + * + * @param additionalCapabilities Specifies additional capabilities enabled or disabled on the virtual + * machine. + * @return the next definition stage. + */ + WithCreate withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); + } + /** The stage of the VirtualMachine definition allowing to specify osProfile. */ + interface WithOsProfile { + /** + * Specifies the osProfile property: Specifies the operating system settings used while creating the virtual + * machine. Some of the settings cannot be changed once VM is provisioned.. + * + * @param osProfile Specifies the operating system settings used while creating the virtual machine. Some of + * the settings cannot be changed once VM is provisioned. + * @return the next definition stage. + */ + WithCreate withOsProfile(OSProfile osProfile); + } + /** The stage of the VirtualMachine definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Specifies the network interfaces of the virtual machine.. + * + * @param networkProfile Specifies the network interfaces of the virtual machine. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(NetworkProfile networkProfile); + } + /** The stage of the VirtualMachine definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Specifies the Security related profile settings for the virtual + * machine.. + * + * @param securityProfile Specifies the Security related profile settings for the virtual machine. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(SecurityProfile securityProfile); + } + /** The stage of the VirtualMachine definition allowing to specify diagnosticsProfile. */ + interface WithDiagnosticsProfile { + /** + * Specifies the diagnosticsProfile property: Specifies the boot diagnostic settings state. + * <br><br>Minimum api-version: 2015-06-15.. + * + * @param diagnosticsProfile Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * @return the next definition stage. + */ + WithCreate withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile); + } + /** The stage of the VirtualMachine definition allowing to specify availabilitySet. */ + interface WithAvailabilitySet { + /** + * Specifies the availabilitySet property: Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same availability set are allocated to + * different nodes to maximize availability. For more information about availability sets, see [Availability + * sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + * <br><br> For more information on Azure planned maintenance, see [Maintenance and updates for + * Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + * <br><br> Currently, a VM can only be added to availability set at creation time. The + * availability set to which the VM is being added should be under the same resource group as the + * availability set resource. An existing VM cannot be added to an availability set. + * <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet + * reference.. + * + * @param availabilitySet Specifies information about the availability set that the virtual machine should + * be assigned to. Virtual machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + * <br><br> For more information on Azure planned maintenance, see [Maintenance and updates + * for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + * <br><br> Currently, a VM can only be added to availability set at creation time. The + * availability set to which the VM is being added should be under the same resource group as the + * availability set resource. An existing VM cannot be added to an availability set. + * <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * @return the next definition stage. + */ + WithCreate withAvailabilitySet(SubResource availabilitySet); + } + /** The stage of the VirtualMachine definition allowing to specify virtualMachineScaleSet. */ + interface WithVirtualMachineScaleSet { + /** + * Specifies the virtualMachineScaleSet property: Specifies information about the virtual machine scale set + * that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine + * scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to + * virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale + * set. <br><br>This property cannot exist along with a non-null properties.availabilitySet + * reference. <br><br>Minimum api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet Specifies information about the virtual machine scale set that the virtual + * machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual + * machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. + * <br><br>This property cannot exist along with a non-null properties.availabilitySet + * reference. <br><br>Minimum api‐version: 2019‐03‐01. + * @return the next definition stage. + */ + WithCreate withVirtualMachineScaleSet(SubResource virtualMachineScaleSet); + } + /** The stage of the VirtualMachine definition allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + /** The stage of the VirtualMachine definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Specifies the priority for the virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param priority Specifies the priority for the virtual machine. <br><br>Minimum api-version: + * 2019-03-01. + * @return the next definition stage. + */ + WithCreate withPriority(VirtualMachinePriorityTypes priority); + } + /** The stage of the VirtualMachine definition allowing to specify evictionPolicy. */ + interface WithEvictionPolicy { + /** + * Specifies the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine + * and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot + * scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview.. + * + * @param evictionPolicy Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are + * supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, + * both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * @return the next definition stage. + */ + WithCreate withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy); + } + /** The stage of the VirtualMachine definition allowing to specify billingProfile. */ + interface WithBillingProfile { + /** + * Specifies the billingProfile property: Specifies the billing related details of a Azure Spot virtual + * machine. <br><br>Minimum api-version: 2019-03-01.. + * + * @param billingProfile Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * @return the next definition stage. + */ + WithCreate withBillingProfile(BillingProfile billingProfile); + } + /** The stage of the VirtualMachine definition allowing to specify host. */ + interface WithHost { + /** + * Specifies the host property: Specifies information about the dedicated host that the virtual machine + * resides in. <br><br>Minimum api-version: 2018-10-01.. + * + * @param host Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * @return the next definition stage. + */ + WithCreate withHost(SubResource host); + } + /** The stage of the VirtualMachine definition allowing to specify hostGroup. */ + interface WithHostGroup { + /** + * Specifies the hostGroup property: Specifies information about the dedicated host group that the virtual + * machine resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User + * cannot specify both host and hostGroup properties.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot + * specify both host and hostGroup properties. + * @return the next definition stage. + */ + WithCreate withHostGroup(SubResource hostGroup); + } + /** The stage of the VirtualMachine definition allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: Specifies that the image or disk that is being used was licensed + * on-premises. <br><br> Possible values for Windows Server operating system are: + * <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + * values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + * <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid + * Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + * <br><br> Minimum api-version: 2015-06-15. + * + * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> + * Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + * Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + * (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + * <br><br> Minimum api-version: 2015-06-15. + * @return the next definition stage. + */ + WithCreate withLicenseType(String licenseType); + } + /** The stage of the VirtualMachine definition allowing to specify extensionsTimeBudget. */ + interface WithExtensionsTimeBudget { + /** + * Specifies the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The + * time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO + * 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: + * 2020-06-01. + * + * @param extensionsTimeBudget Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. + * The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + WithCreate withExtensionsTimeBudget(String extensionsTimeBudget); + } + /** The stage of the VirtualMachine definition allowing to specify platformFaultDomain. */ + interface WithPlatformFaultDomain { + /** + * Specifies the platformFaultDomain property: Specifies the scale set logical fault domain into which the + * Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a + * fault domain that best maintains balance across available fault domains.<br><li>This is + * applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The + * Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' &gt; + * 1.<li>This property cannot be updated once the Virtual Machine is created.<li>Fault domain + * assignment can be viewed in the Virtual Machine Instance View.<br><br>Minimum api‐version: + * 2020‐12‐01. + * + * @param platformFaultDomain Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain + * that best maintains balance across available fault domains.<br><li>This is applicable + * only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual + * Machine Scale Set that is referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This + * property cannot be updated once the Virtual Machine is created.<li>Fault domain assignment can + * be viewed in the Virtual Machine Instance View.<br><br>Minimum api‐version: 2020‐12‐01. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the VirtualMachine definition allowing to specify scheduledEventsProfile. */ + interface WithScheduledEventsProfile { + /** + * Specifies the scheduledEventsProfile property: Specifies Scheduled Event related configurations.. + * + * @param scheduledEventsProfile Specifies Scheduled Event related configurations. + * @return the next definition stage. + */ + WithCreate withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile); + } + /** The stage of the VirtualMachine definition allowing to specify userData. */ + interface WithUserData { + /** + * Specifies the userData property: UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets + * in here. <br><br>Minimum api-version: 2021-03-01. + * @return the next definition stage. + */ + WithCreate withUserData(String userData); + } + /** The stage of the VirtualMachine definition allowing to specify capacityReservation. */ + interface WithCapacityReservation { + /** + * Specifies the capacityReservation property: Specifies information about the capacity reservation that is + * used to allocate virtual machine. <br><br>Minimum api-version: 2021-04-01.. + * + * @param capacityReservation Specifies information about the capacity reservation that is used to allocate + * virtual machine. <br><br>Minimum api-version: 2021-04-01. + * @return the next definition stage. + */ + WithCreate withCapacityReservation(CapacityReservationProfile capacityReservation); + } + } + /** + * 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.WithPlan, + UpdateStages.WithIdentity, + UpdateStages.WithZones, + UpdateStages.WithHardwareProfile, + UpdateStages.WithStorageProfile, + UpdateStages.WithAdditionalCapabilities, + UpdateStages.WithOsProfile, + UpdateStages.WithNetworkProfile, + UpdateStages.WithSecurityProfile, + UpdateStages.WithDiagnosticsProfile, + UpdateStages.WithAvailabilitySet, + UpdateStages.WithVirtualMachineScaleSet, + UpdateStages.WithProximityPlacementGroup, + UpdateStages.WithPriority, + UpdateStages.WithEvictionPolicy, + UpdateStages.WithBillingProfile, + UpdateStages.WithHost, + UpdateStages.WithHostGroup, + UpdateStages.WithLicenseType, + UpdateStages.WithExtensionsTimeBudget, + UpdateStages.WithPlatformFaultDomain, + UpdateStages.WithScheduledEventsProfile, + UpdateStages.WithUserData, + UpdateStages.WithCapacityReservation { + /** + * 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: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the VirtualMachine update allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: Specifies information about the marketplace image used to create the virtual + * machine. This element is only used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that + * you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**.. + * + * @param plan Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the marketplace image that you + * want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**. + * @return the next definition stage. + */ + Update withPlan(Plan plan); + } + /** The stage of the VirtualMachine update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the virtual machine, if configured.. + * + * @param identity The identity of the virtual machine, if configured. + * @return the next definition stage. + */ + Update withIdentity(VirtualMachineIdentity identity); + } + /** The stage of the VirtualMachine update allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The virtual machine zones.. + * + * @param zones The virtual machine zones. + * @return the next definition stage. + */ + Update withZones(List zones); + } + /** The stage of the VirtualMachine update allowing to specify hardwareProfile. */ + interface WithHardwareProfile { + /** + * Specifies the hardwareProfile property: Specifies the hardware settings for the virtual machine.. + * + * @param hardwareProfile Specifies the hardware settings for the virtual machine. + * @return the next definition stage. + */ + Update withHardwareProfile(HardwareProfile hardwareProfile); + } + /** The stage of the VirtualMachine update allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: Specifies the storage settings for the virtual machine disks.. + * + * @param storageProfile Specifies the storage settings for the virtual machine disks. + * @return the next definition stage. + */ + Update withStorageProfile(StorageProfile storageProfile); + } + /** The stage of the VirtualMachine update allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Specifies additional capabilities enabled or disabled on + * the virtual machine.. + * + * @param additionalCapabilities Specifies additional capabilities enabled or disabled on the virtual + * machine. + * @return the next definition stage. + */ + Update withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); + } + /** The stage of the VirtualMachine update allowing to specify osProfile. */ + interface WithOsProfile { + /** + * Specifies the osProfile property: Specifies the operating system settings used while creating the virtual + * machine. Some of the settings cannot be changed once VM is provisioned.. + * + * @param osProfile Specifies the operating system settings used while creating the virtual machine. Some of + * the settings cannot be changed once VM is provisioned. + * @return the next definition stage. + */ + Update withOsProfile(OSProfile osProfile); + } + /** The stage of the VirtualMachine update allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Specifies the network interfaces of the virtual machine.. + * + * @param networkProfile Specifies the network interfaces of the virtual machine. + * @return the next definition stage. + */ + Update withNetworkProfile(NetworkProfile networkProfile); + } + /** The stage of the VirtualMachine update allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Specifies the Security related profile settings for the virtual + * machine.. + * + * @param securityProfile Specifies the Security related profile settings for the virtual machine. + * @return the next definition stage. + */ + Update withSecurityProfile(SecurityProfile securityProfile); + } + /** The stage of the VirtualMachine update allowing to specify diagnosticsProfile. */ + interface WithDiagnosticsProfile { + /** + * Specifies the diagnosticsProfile property: Specifies the boot diagnostic settings state. + * <br><br>Minimum api-version: 2015-06-15.. + * + * @param diagnosticsProfile Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * @return the next definition stage. + */ + Update withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile); + } + /** The stage of the VirtualMachine update allowing to specify availabilitySet. */ + interface WithAvailabilitySet { + /** + * Specifies the availabilitySet property: Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same availability set are allocated to + * different nodes to maximize availability. For more information about availability sets, see [Availability + * sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + * <br><br> For more information on Azure planned maintenance, see [Maintenance and updates for + * Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + * <br><br> Currently, a VM can only be added to availability set at creation time. The + * availability set to which the VM is being added should be under the same resource group as the + * availability set resource. An existing VM cannot be added to an availability set. + * <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet + * reference.. + * + * @param availabilitySet Specifies information about the availability set that the virtual machine should + * be assigned to. Virtual machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). + * <br><br> For more information on Azure planned maintenance, see [Maintenance and updates + * for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) + * <br><br> Currently, a VM can only be added to availability set at creation time. The + * availability set to which the VM is being added should be under the same resource group as the + * availability set resource. An existing VM cannot be added to an availability set. + * <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * @return the next definition stage. + */ + Update withAvailabilitySet(SubResource availabilitySet); + } + /** The stage of the VirtualMachine update allowing to specify virtualMachineScaleSet. */ + interface WithVirtualMachineScaleSet { + /** + * Specifies the virtualMachineScaleSet property: Specifies information about the virtual machine scale set + * that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine + * scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to + * virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale + * set. <br><br>This property cannot exist along with a non-null properties.availabilitySet + * reference. <br><br>Minimum api‐version: 2019‐03‐01. + * + * @param virtualMachineScaleSet Specifies information about the virtual machine scale set that the virtual + * machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual + * machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. + * <br><br>This property cannot exist along with a non-null properties.availabilitySet + * reference. <br><br>Minimum api‐version: 2019‐03‐01. + * @return the next definition stage. + */ + Update withVirtualMachineScaleSet(SubResource virtualMachineScaleSet); + } + /** The stage of the VirtualMachine update allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + Update withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + /** The stage of the VirtualMachine update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Specifies the priority for the virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param priority Specifies the priority for the virtual machine. <br><br>Minimum api-version: + * 2019-03-01. + * @return the next definition stage. + */ + Update withPriority(VirtualMachinePriorityTypes priority); + } + /** The stage of the VirtualMachine update allowing to specify evictionPolicy. */ + interface WithEvictionPolicy { + /** + * Specifies the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine + * and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot + * scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview.. + * + * @param evictionPolicy Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are + * supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, + * both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * @return the next definition stage. + */ + Update withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy); + } + /** The stage of the VirtualMachine update allowing to specify billingProfile. */ + interface WithBillingProfile { + /** + * Specifies the billingProfile property: Specifies the billing related details of a Azure Spot virtual + * machine. <br><br>Minimum api-version: 2019-03-01.. + * + * @param billingProfile Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * @return the next definition stage. + */ + Update withBillingProfile(BillingProfile billingProfile); + } + /** The stage of the VirtualMachine update allowing to specify host. */ + interface WithHost { + /** + * Specifies the host property: Specifies information about the dedicated host that the virtual machine + * resides in. <br><br>Minimum api-version: 2018-10-01.. + * + * @param host Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * @return the next definition stage. + */ + Update withHost(SubResource host); + } + /** The stage of the VirtualMachine update allowing to specify hostGroup. */ + interface WithHostGroup { + /** + * Specifies the hostGroup property: Specifies information about the dedicated host group that the virtual + * machine resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User + * cannot specify both host and hostGroup properties.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine resides + * in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot + * specify both host and hostGroup properties. + * @return the next definition stage. + */ + Update withHostGroup(SubResource hostGroup); + } + /** The stage of the VirtualMachine update allowing to specify licenseType. */ + interface WithLicenseType { + /** + * Specifies the licenseType property: Specifies that the image or disk that is being used was licensed + * on-premises. <br><br> Possible values for Windows Server operating system are: + * <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible + * values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) + * <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid + * Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + * <br><br> Minimum api-version: 2015-06-15. + * + * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> + * Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + * Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + * (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + * <br><br> Minimum api-version: 2015-06-15. + * @return the next definition stage. + */ + Update withLicenseType(String licenseType); + } + /** The stage of the VirtualMachine update allowing to specify extensionsTimeBudget. */ + interface WithExtensionsTimeBudget { + /** + * Specifies the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The + * time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO + * 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: + * 2020-06-01. + * + * @param extensionsTimeBudget Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. + * The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + Update withExtensionsTimeBudget(String extensionsTimeBudget); + } + /** The stage of the VirtualMachine update allowing to specify platformFaultDomain. */ + interface WithPlatformFaultDomain { + /** + * Specifies the platformFaultDomain property: Specifies the scale set logical fault domain into which the + * Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a + * fault domain that best maintains balance across available fault domains.<br><li>This is + * applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The + * Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' &gt; + * 1.<li>This property cannot be updated once the Virtual Machine is created.<li>Fault domain + * assignment can be viewed in the Virtual Machine Instance View.<br><br>Minimum api‐version: + * 2020‐12‐01. + * + * @param platformFaultDomain Specifies the scale set logical fault domain into which the Virtual Machine + * will be created. By default, the Virtual Machine will by automatically assigned to a fault domain + * that best maintains balance across available fault domains.<br><li>This is applicable + * only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual + * Machine Scale Set that is referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This + * property cannot be updated once the Virtual Machine is created.<li>Fault domain assignment can + * be viewed in the Virtual Machine Instance View.<br><br>Minimum api‐version: 2020‐12‐01. + * @return the next definition stage. + */ + Update withPlatformFaultDomain(Integer platformFaultDomain); + } + /** The stage of the VirtualMachine update allowing to specify scheduledEventsProfile. */ + interface WithScheduledEventsProfile { + /** + * Specifies the scheduledEventsProfile property: Specifies Scheduled Event related configurations.. + * + * @param scheduledEventsProfile Specifies Scheduled Event related configurations. + * @return the next definition stage. + */ + Update withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile); + } + /** The stage of the VirtualMachine update allowing to specify userData. */ + interface WithUserData { + /** + * Specifies the userData property: UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets + * in here. <br><br>Minimum api-version: 2021-03-01. + * @return the next definition stage. + */ + Update withUserData(String userData); + } + /** The stage of the VirtualMachine update allowing to specify capacityReservation. */ + interface WithCapacityReservation { + /** + * Specifies the capacityReservation property: Specifies information about the capacity reservation that is + * used to allocate virtual machine. <br><br>Minimum api-version: 2021-04-01.. + * + * @param capacityReservation Specifies information about the capacity reservation that is used to allocate + * virtual machine. <br><br>Minimum api-version: 2021-04-01. + * @return the next definition stage. + */ + Update withCapacityReservation(CapacityReservationProfile capacityReservation); + } + } + /** + * 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); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture(VirtualMachineCaptureParameters parameters, Context context); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @throws com.azure.core.management.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 convertToManagedDisks(); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void convertToManagedDisks(Context context); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @throws com.azure.core.management.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 deallocate(); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @throws com.azure.core.management.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 generalize(); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response generalizeWithResponse(Context context); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(Boolean skipShutdown); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this 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 powerOff(); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(Boolean skipShutdown, Context context); + + /** + * The operation to reapply a virtual machine's state. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(); + + /** + * The operation to reapply a virtual machine's state. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(Context context); + + /** + * The operation to restart a 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(); + + /** + * The operation to restart a 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); + + /** + * The operation to start a 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(); + + /** + * The operation to start a 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); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(Context context); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(VirtualMachineReimageParameters parameters); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @throws com.azure.core.management.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 reimage(); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(VirtualMachineReimageParameters parameters, Context context); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData(); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + Response retrieveBootDiagnosticsDataWithResponse( + Integer sasUriExpirationTimeInMinutes, Context context); + + /** + * The operation to perform maintenance on a 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 performMaintenance(); + + /** + * The operation to perform maintenance on a 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 performMaintenance(Context context); + + /** + * The operation to simulate the eviction of spot 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 simulateEviction(); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response simulateEvictionWithResponse(Context context); + + /** + * Assess patches on the VM. + * + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(); + + /** + * Assess patches on the VM. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(Context context); + + /** + * Installs patches on the VM. + * + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches(VirtualMachineInstallPatchesParameters installPatchesInput); + + /** + * Installs patches on the VM. + * + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches( + VirtualMachineInstallPatchesParameters installPatchesInput, Context context); + + /** + * Run command on the VM. + * + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + RunCommandResult runCommand(RunCommandInput parameters); + + /** + * Run command on the VM. + * + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(RunCommandInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java new file mode 100644 index 0000000000000..76e015e162cd4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAgentInstanceView.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of the VM Agent running on the virtual machine. */ +@Fluent +public final class VirtualMachineAgentInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAgentInstanceView.class); + + /* + * The VM Agent full version. + */ + @JsonProperty(value = "vmAgentVersion") + private String vmAgentVersion; + + /* + * The virtual machine extension handler instance view. + */ + @JsonProperty(value = "extensionHandlers") + private List extensionHandlers; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the vmAgentVersion property: The VM Agent full version. + * + * @return the vmAgentVersion value. + */ + public String vmAgentVersion() { + return this.vmAgentVersion; + } + + /** + * Set the vmAgentVersion property: The VM Agent full version. + * + * @param vmAgentVersion the vmAgentVersion value to set. + * @return the VirtualMachineAgentInstanceView object itself. + */ + public VirtualMachineAgentInstanceView withVmAgentVersion(String vmAgentVersion) { + this.vmAgentVersion = vmAgentVersion; + return this; + } + + /** + * Get the extensionHandlers property: The virtual machine extension handler instance view. + * + * @return the extensionHandlers value. + */ + public List extensionHandlers() { + return this.extensionHandlers; + } + + /** + * Set the extensionHandlers property: The virtual machine extension handler instance view. + * + * @param extensionHandlers the extensionHandlers value to set. + * @return the VirtualMachineAgentInstanceView object itself. + */ + public VirtualMachineAgentInstanceView withExtensionHandlers( + List extensionHandlers) { + this.extensionHandlers = extensionHandlers; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineAgentInstanceView object itself. + */ + public VirtualMachineAgentInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionHandlers() != null) { + extensionHandlers().forEach(e -> e.validate()); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAssessPatchesResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAssessPatchesResult.java new file mode 100644 index 0000000000000..5406f393b6385 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineAssessPatchesResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineAssessPatchesResult. */ +public interface VirtualMachineAssessPatchesResult { + /** + * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + PatchOperationStatus status(); + + /** + * Gets the assessmentActivityId property: The activity ID of the operation that produced this result. It is used to + * correlate across CRP and extension logs. + * + * @return the assessmentActivityId value. + */ + String assessmentActivityId(); + + /** + * Gets the rebootPending property: The overall reboot status of the VM. It will be true when partially installed + * patches require a reboot to complete installation but the reboot has not yet occurred. + * + * @return the rebootPending value. + */ + Boolean rebootPending(); + + /** + * Gets the criticalAndSecurityPatchCount property: The number of critical or security patches that have been + * detected as available and not yet installed. + * + * @return the criticalAndSecurityPatchCount value. + */ + Integer criticalAndSecurityPatchCount(); + + /** + * Gets the otherPatchCount property: The number of all available patches excluding critical and security. + * + * @return the otherPatchCount value. + */ + Integer otherPatchCount(); + + /** + * Gets the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the availablePatches property: The list of patches that have been detected as available for installation. + * + * @return the availablePatches value. + */ + List availablePatches(); + + /** + * Gets the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + ApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineAssessPatchesResultInner + * object. + * + * @return the inner object. + */ + VirtualMachineAssessPatchesResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.java new file mode 100644 index 0000000000000..e05d5d89ad3b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureParameters.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Capture Virtual Machine parameters. */ +@Fluent +public final class VirtualMachineCaptureParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineCaptureParameters.class); + + /* + * The captured virtual hard disk's name prefix. + */ + @JsonProperty(value = "vhdPrefix", required = true) + private String vhdPrefix; + + /* + * The destination container name. + */ + @JsonProperty(value = "destinationContainerName", required = true) + private String destinationContainerName; + + /* + * Specifies whether to overwrite the destination virtual hard disk, in + * case of conflict. + */ + @JsonProperty(value = "overwriteVhds", required = true) + private boolean overwriteVhds; + + /** + * Get the vhdPrefix property: The captured virtual hard disk's name prefix. + * + * @return the vhdPrefix value. + */ + public String vhdPrefix() { + return this.vhdPrefix; + } + + /** + * Set the vhdPrefix property: The captured virtual hard disk's name prefix. + * + * @param vhdPrefix the vhdPrefix value to set. + * @return the VirtualMachineCaptureParameters object itself. + */ + public VirtualMachineCaptureParameters withVhdPrefix(String vhdPrefix) { + this.vhdPrefix = vhdPrefix; + return this; + } + + /** + * Get the destinationContainerName property: The destination container name. + * + * @return the destinationContainerName value. + */ + public String destinationContainerName() { + return this.destinationContainerName; + } + + /** + * Set the destinationContainerName property: The destination container name. + * + * @param destinationContainerName the destinationContainerName value to set. + * @return the VirtualMachineCaptureParameters object itself. + */ + public VirtualMachineCaptureParameters withDestinationContainerName(String destinationContainerName) { + this.destinationContainerName = destinationContainerName; + return this; + } + + /** + * Get the overwriteVhds property: Specifies whether to overwrite the destination virtual hard disk, in case of + * conflict. + * + * @return the overwriteVhds value. + */ + public boolean overwriteVhds() { + return this.overwriteVhds; + } + + /** + * Set the overwriteVhds property: Specifies whether to overwrite the destination virtual hard disk, in case of + * conflict. + * + * @param overwriteVhds the overwriteVhds value to set. + * @return the VirtualMachineCaptureParameters object itself. + */ + public VirtualMachineCaptureParameters withOverwriteVhds(boolean overwriteVhds) { + this.overwriteVhds = overwriteVhds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vhdPrefix() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vhdPrefix in model VirtualMachineCaptureParameters")); + } + if (destinationContainerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationContainerName in model VirtualMachineCaptureParameters")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureResult.java new file mode 100644 index 0000000000000..a74c452ae2773 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineCaptureResult.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineCaptureResult. */ +public interface VirtualMachineCaptureResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the schema property: the schema of the captured virtual machine. + * + * @return the schema value. + */ + String schema(); + + /** + * Gets the contentVersion property: the version of the content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the parameters property: parameters of the captured virtual machine. + * + * @return the parameters value. + */ + Object parameters(); + + /** + * Gets the resources property: a list of resource items of the captured virtual machine. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineCaptureResultInner object. + * + * @return the inner object. + */ + VirtualMachineCaptureResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.java new file mode 100644 index 0000000000000..e01520d9e69f0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineEvictionPolicyTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualMachineEvictionPolicyTypes. */ +public final class VirtualMachineEvictionPolicyTypes extends ExpandableStringEnum { + /** Static value Deallocate for VirtualMachineEvictionPolicyTypes. */ + public static final VirtualMachineEvictionPolicyTypes DEALLOCATE = fromString("Deallocate"); + + /** Static value Delete for VirtualMachineEvictionPolicyTypes. */ + public static final VirtualMachineEvictionPolicyTypes DELETE = fromString("Delete"); + + /** + * Creates or finds a VirtualMachineEvictionPolicyTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineEvictionPolicyTypes. + */ + @JsonCreator + public static VirtualMachineEvictionPolicyTypes fromString(String name) { + return fromString(name, VirtualMachineEvictionPolicyTypes.class); + } + + /** @return known VirtualMachineEvictionPolicyTypes values. */ + public static Collection values() { + return values(VirtualMachineEvictionPolicyTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java new file mode 100644 index 0000000000000..74b0e3f1c506a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtension.java @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionInner; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineExtension. */ +public interface VirtualMachineExtension { + /** + * 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 forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Object settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + VirtualMachineExtensionInstanceView instanceView(); + + /** + * 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.compute.generated.fluent.models.VirtualMachineExtensionInner object. + * + * @return the inner object. + */ + VirtualMachineExtensionInner innerModel(); + + /** The entirety of the VirtualMachineExtension definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The VirtualMachineExtension definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineExtension definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachineExtension definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the VirtualMachineExtension definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vmName. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @return the next definition stage. + */ + WithCreate withExistingVirtualMachine(String resourceGroupName, String vmName); + } + /** + * The stage of the VirtualMachineExtension 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.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachineExtension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachineExtension create(Context context); + } + /** The stage of the VirtualMachineExtension 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 VirtualMachineExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineExtension definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the VirtualMachineExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the VirtualMachineExtension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the VirtualMachineExtension definition allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineExtension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineExtension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Object settings); + } + /** The stage of the VirtualMachineExtension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + /** The stage of the VirtualMachineExtension definition allowing to specify instanceView. */ + interface WithInstanceView { + /** + * Specifies the instanceView property: The virtual machine extension instance view.. + * + * @param instanceView The virtual machine extension instance view. + * @return the next definition stage. + */ + WithCreate withInstanceView(VirtualMachineExtensionInstanceView instanceView); + } + } + /** + * Begins update for the VirtualMachineExtension resource. + * + * @return the stage of resource update. + */ + VirtualMachineExtension.Update update(); + + /** The template for VirtualMachineExtension update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachineExtension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachineExtension apply(Context context); + } + /** The VirtualMachineExtension update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachineExtension 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); + } + /** The stage of the VirtualMachineExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the VirtualMachineExtension update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Specifies the type of the extension; an example is "CustomScriptExtension".. + * + * @param type Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the VirtualMachineExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the VirtualMachineExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Object settings); + } + /** The stage of the VirtualMachineExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + Update withProtectedSettings(Object protectedSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineExtension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineExtension refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.java new file mode 100644 index 0000000000000..f77fd0bed1c41 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionHandlerInstanceView.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The instance view of a virtual machine extension handler. */ +@Fluent +public final class VirtualMachineExtensionHandlerInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionHandlerInstanceView.class); + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * The extension handler status. + */ + @JsonProperty(value = "status") + private InstanceViewStatus status; + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionHandlerInstanceView object itself. + */ + public VirtualMachineExtensionHandlerInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionHandlerInstanceView object itself. + */ + public VirtualMachineExtensionHandlerInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the status property: The extension handler status. + * + * @return the status value. + */ + public InstanceViewStatus status() { + return this.status; + } + + /** + * Set the status property: The extension handler status. + * + * @param status the status value to set. + * @return the VirtualMachineExtensionHandlerInstanceView object itself. + */ + public VirtualMachineExtensionHandlerInstanceView withStatus(InstanceViewStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImage.java new file mode 100644 index 0000000000000..8f2166797dd98 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImage.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineExtensionImage. */ +public interface VirtualMachineExtensionImage { + /** + * 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 operatingSystem property: The operating system this extension supports. + * + * @return the operatingSystem value. + */ + String operatingSystem(); + + /** + * Gets the computeRole property: The type of role (IaaS or PaaS) this extension supports. + * + * @return the computeRole value. + */ + String computeRole(); + + /** + * Gets the handlerSchema property: The schema defined by publisher, where extension consumers should provide + * settings in a matching schema. + * + * @return the handlerSchema value. + */ + String handlerSchema(); + + /** + * Gets the vmScaleSetEnabled property: Whether the extension can be used on xRP VMScaleSets. By default existing + * extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the + * extension is only enabled for CRP VMs but not VMSS. + * + * @return the vmScaleSetEnabled value. + */ + Boolean vmScaleSetEnabled(); + + /** + * Gets the supportsMultipleExtensions property: Whether the handler can support multiple extensions. + * + * @return the supportsMultipleExtensions value. + */ + Boolean supportsMultipleExtensions(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionImageInner + * object. + * + * @return the inner object. + */ + VirtualMachineExtensionImageInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.java new file mode 100644 index 0000000000000..a473657bae391 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionImages.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of VirtualMachineExtensionImages. */ +public interface VirtualMachineExtensionImages { + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + VirtualMachineExtensionImage get(String location, String publisherName, String type, String version); + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + Response getWithResponse( + String location, String publisherName, String type, String version, Context context); + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + List listTypes(String location, String publisherName); + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + Response> listTypesWithResponse( + String location, String publisherName, Context context); + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + List listVersions(String location, String publisherName, String type); + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + Response> listVersionsWithResponse( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.java new file mode 100644 index 0000000000000..b7868c1f49ae6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionInstanceView.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a virtual machine extension. */ +@Fluent +public final class VirtualMachineExtensionInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionInstanceView.class); + + /* + * The virtual machine extension name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * The resource status information. + */ + @JsonProperty(value = "substatuses") + private List substatuses; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the name property: The virtual machine extension name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The virtual machine extension name. + * + * @param name the name value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the substatuses property: The resource status information. + * + * @return the substatuses value. + */ + public List substatuses() { + return this.substatuses; + } + + /** + * Set the substatuses property: The resource status information. + * + * @param substatuses the substatuses value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withSubstatuses(List substatuses) { + this.substatuses = substatuses; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (substatuses() != null) { + substatuses().forEach(e -> e.validate()); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java new file mode 100644 index 0000000000000..dcc0775fb846a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionUpdate.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineExtensionUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionUpdate.class); + + /* + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineExtensionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.java new file mode 100644 index 0000000000000..c5c7106ff1b2e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensions.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachineExtensions. */ +public interface VirtualMachineExtensions { + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, String vmExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, String vmExtensionName, Context context); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + VirtualMachineExtension get(String resourceGroupName, String vmName, String vmExtensionName); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + Response getWithResponse( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context); + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + VirtualMachineExtensionsListResult list(String resourceGroupName, String vmName); + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Extension operation response. + */ + Response listWithResponse( + String resourceGroupName, String vmName, String expand, Context context); + + /** + * The operation to get the extension. + * + * @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 describes a Virtual Machine Extension. + */ + VirtualMachineExtension getById(String id); + + /** + * The operation to get the extension. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Extension. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * The operation to delete the extension. + * + * @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); + + /** + * The operation to delete the extension. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualMachineExtension resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineExtension definition. + */ + VirtualMachineExtension.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionsListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionsListResult.java new file mode 100644 index 0000000000000..578d162d718a0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineExtensionsListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineExtensionsListResult. */ +public interface VirtualMachineExtensionsListResult { + /** + * Gets the value property: The list of extensions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineExtensionsListResultInner + * object. + * + * @return the inner object. + */ + VirtualMachineExtensionsListResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineHealthStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineHealthStatus.java new file mode 100644 index 0000000000000..a47cb628725b6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineHealthStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The health status of the VM. */ +@Immutable +public final class VirtualMachineHealthStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineHealthStatus.class); + + /* + * The health status information for the VM. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private InstanceViewStatus status; + + /** + * Get the status property: The health status information for the VM. + * + * @return the status value. + */ + public InstanceViewStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIdentity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIdentity.java new file mode 100644 index 0000000000000..0e41ee1d70305 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIdentity.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the virtual machine. */ +@Fluent +public class VirtualMachineIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineIdentity.class); + + /* + * The principal id of virtual machine identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id associated with the virtual machine. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the virtual machine. The type + * 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the virtual machine. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the Virtual Machine. The + * user identity dictionary key references will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of virtual machine identity. This property will only be provided + * for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the virtual machine. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @param type the type value to set. + * @return the VirtualMachineIdentity object itself. + */ + public VirtualMachineIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the Virtual Machine. The + * user identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the Virtual Machine. The + * user identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the VirtualMachineIdentity object itself. + */ + public VirtualMachineIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.java new file mode 100644 index 0000000000000..bbf8f58063763 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImage.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineImage. */ +public interface VirtualMachineImage { + /** + * 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 location property: The supported Azure location of the resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Specifies the tags that are assigned to the virtual machine. For more information about + * using tags, see [Using tags to organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the plan property: Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. + * + * @return the plan value. + */ + PurchasePlan plan(); + + /** + * Gets the osDiskImage property: Contains the os disk image information. + * + * @return the osDiskImage value. + */ + OSDiskImage osDiskImage(); + + /** + * Gets the dataDiskImages property: The dataDiskImages property. + * + * @return the dataDiskImages value. + */ + List dataDiskImages(); + + /** + * Gets the automaticOSUpgradeProperties property: Describes automatic OS upgrade properties on the image. + * + * @return the automaticOSUpgradeProperties value. + */ + AutomaticOSUpgradeProperties automaticOSUpgradeProperties(); + + /** + * Gets the hyperVGeneration property: Specifies the HyperVGeneration Type. + * + * @return the hyperVGeneration value. + */ + HyperVGenerationTypes hyperVGeneration(); + + /** + * Gets the disallowed property: Specifies disallowed configuration for the VirtualMachine created from the image. + * + * @return the disallowed value. + */ + DisallowedConfiguration disallowed(); + + /** + * Gets the features property: The features property. + * + * @return the features value. + */ + List features(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageInner object. + * + * @return the inner object. + */ + VirtualMachineImageInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageFeature.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageFeature.java new file mode 100644 index 0000000000000..533fd0504d8cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageFeature.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies additional capabilities supported by the image. */ +@Fluent +public final class VirtualMachineImageFeature { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageFeature.class); + + /* + * The name of the feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The corresponding value for the feature. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The name of the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the feature. + * + * @param name the name value to set. + * @return the VirtualMachineImageFeature object itself. + */ + public VirtualMachineImageFeature withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The corresponding value for the feature. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The corresponding value for the feature. + * + * @param value the value value to set. + * @return the VirtualMachineImageFeature object itself. + */ + public VirtualMachineImageFeature withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageResource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageResource.java new file mode 100644 index 0000000000000..0c110c36a3d2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImageResource.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineImageResource. */ +public interface VirtualMachineImageResource { + /** + * 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 location property: The supported Azure location of the resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Specifies the tags that are assigned to the virtual machine. For more information about + * using tags, see [Using tags to organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineImageResourceInner object. + * + * @return the inner object. + */ + VirtualMachineImageResourceInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java new file mode 100644 index 0000000000000..0c28bfa3532b5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImages.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of VirtualMachineImages. */ +public interface VirtualMachineImages { + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + VirtualMachineImage get(String location, String publisherName, String offer, String skus, String version); + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image. + */ + Response getWithResponse( + String location, String publisherName, String offer, String skus, String version, Context context); + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + List list(String location, String publisherName, String offer, String skus); + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + Response> listWithResponse( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context); + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + List listOffers(String location, String publisherName); + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + Response> listOffersWithResponse( + String location, String publisherName, Context context); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + List listPublishers(String location); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + Response> listPublishersWithResponse(String location, Context context); + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + List listSkus(String location, String publisherName, String offer); + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + Response> listSkusWithResponse( + String location, String publisherName, String offer, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.java new file mode 100644 index 0000000000000..fec97265f7281 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineImagesEdgeZones.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of VirtualMachineImagesEdgeZones. */ +public interface VirtualMachineImagesEdgeZones { + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + VirtualMachineImage get( + String location, String edgeZone, String publisherName, String offer, String skus, String version); + + /** + * Gets a virtual machine image in an edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine image in an edge zone. + */ + Response getWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String version, + Context context); + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + List list( + String location, String edgeZone, String publisherName, String offer, String skus); + + /** + * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top An integer value specifying the number of images to return that matches supplied values. + * @param orderby Specifies the order of the results returned. Formatted as an OData query. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and + * SKU. + */ + Response> listWithResponse( + String location, + String edgeZone, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context); + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + List listOffers(String location, String edgeZone, String publisherName); + + /** + * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location, edge zone and publisher. + */ + Response> listOffersWithResponse( + String location, String edgeZone, String publisherName, Context context); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + List listPublishers(String location, String edgeZone); + + /** + * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location and edge zone. + */ + Response> listPublishersWithResponse( + String location, String edgeZone, Context context); + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + List listSkus(String location, String edgeZone, String publisherName, String offer); + + /** + * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param edgeZone The name of the edge zone. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + */ + Response> listSkusWithResponse( + String location, String edgeZone, String publisherName, String offer, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.java new file mode 100644 index 0000000000000..62a3f90e9a70c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesParameters.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for InstallPatches as directly received by the API. */ +@Fluent +public final class VirtualMachineInstallPatchesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInstallPatchesParameters.class); + + /* + * Specifies the maximum amount of time that the operation will run. It + * must be an ISO 8601-compliant duration string such as PT4H (4 hours) + */ + @JsonProperty(value = "maximumDuration", required = true) + private String maximumDuration; + + /* + * Defines when it is acceptable to reboot a VM during a software update + * operation. + */ + @JsonProperty(value = "rebootSetting", required = true) + private VMGuestPatchRebootSetting rebootSetting; + + /* + * Input for InstallPatches on a Windows VM, as directly received by the + * API + */ + @JsonProperty(value = "windowsParameters") + private WindowsParameters windowsParameters; + + /* + * Input for InstallPatches on a Linux VM, as directly received by the API + */ + @JsonProperty(value = "linuxParameters") + private LinuxParameters linuxParameters; + + /** + * Get the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an + * ISO 8601-compliant duration string such as PT4H (4 hours). + * + * @return the maximumDuration value. + */ + public String maximumDuration() { + return this.maximumDuration; + } + + /** + * Set the maximumDuration property: Specifies the maximum amount of time that the operation will run. It must be an + * ISO 8601-compliant duration string such as PT4H (4 hours). + * + * @param maximumDuration the maximumDuration value to set. + * @return the VirtualMachineInstallPatchesParameters object itself. + */ + public VirtualMachineInstallPatchesParameters withMaximumDuration(String maximumDuration) { + this.maximumDuration = maximumDuration; + return this; + } + + /** + * Get the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. + * + * @return the rebootSetting value. + */ + public VMGuestPatchRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Defines when it is acceptable to reboot a VM during a software update operation. + * + * @param rebootSetting the rebootSetting value to set. + * @return the VirtualMachineInstallPatchesParameters object itself. + */ + public VirtualMachineInstallPatchesParameters withRebootSetting(VMGuestPatchRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. + * + * @return the windowsParameters value. + */ + public WindowsParameters windowsParameters() { + return this.windowsParameters; + } + + /** + * Set the windowsParameters property: Input for InstallPatches on a Windows VM, as directly received by the API. + * + * @param windowsParameters the windowsParameters value to set. + * @return the VirtualMachineInstallPatchesParameters object itself. + */ + public VirtualMachineInstallPatchesParameters withWindowsParameters(WindowsParameters windowsParameters) { + this.windowsParameters = windowsParameters; + return this; + } + + /** + * Get the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. + * + * @return the linuxParameters value. + */ + public LinuxParameters linuxParameters() { + return this.linuxParameters; + } + + /** + * Set the linuxParameters property: Input for InstallPatches on a Linux VM, as directly received by the API. + * + * @param linuxParameters the linuxParameters value to set. + * @return the VirtualMachineInstallPatchesParameters object itself. + */ + public VirtualMachineInstallPatchesParameters withLinuxParameters(LinuxParameters linuxParameters) { + this.linuxParameters = linuxParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (maximumDuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property maximumDuration in model VirtualMachineInstallPatchesParameters")); + } + if (rebootSetting() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rebootSetting in model VirtualMachineInstallPatchesParameters")); + } + if (windowsParameters() != null) { + windowsParameters().validate(); + } + if (linuxParameters() != null) { + linuxParameters().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesResult.java new file mode 100644 index 0000000000000..b29af4356f73a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstallPatchesResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineInstallPatchesResult. */ +public interface VirtualMachineInstallPatchesResult { + /** + * Gets the status property: The overall success or failure status of the operation. It remains "InProgress" until + * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or + * "CompletedWithWarnings.". + * + * @return the status value. + */ + PatchOperationStatus status(); + + /** + * Gets the installationActivityId property: The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + * + * @return the installationActivityId value. + */ + String installationActivityId(); + + /** + * Gets the rebootStatus property: The reboot state of the VM following completion of the operation. + * + * @return the rebootStatus value. + */ + VMGuestPatchRebootStatus rebootStatus(); + + /** + * Gets the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its + * intended actions. + * + * @return the maintenanceWindowExceeded value. + */ + Boolean maintenanceWindowExceeded(); + + /** + * Gets the excludedPatchCount property: The number of patches that were not installed due to the user blocking + * their installation. + * + * @return the excludedPatchCount value. + */ + Integer excludedPatchCount(); + + /** + * Gets the notSelectedPatchCount property: The number of patches that were detected as available for install, but + * did not meet the operation's criteria. + * + * @return the notSelectedPatchCount value. + */ + Integer notSelectedPatchCount(); + + /** + * Gets the pendingPatchCount property: The number of patches that were identified as meeting the installation + * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + * + * @return the pendingPatchCount value. + */ + Integer pendingPatchCount(); + + /** + * Gets the installedPatchCount property: The number of patches successfully installed. + * + * @return the installedPatchCount value. + */ + Integer installedPatchCount(); + + /** + * Gets the failedPatchCount property: The number of patches that could not be installed due to some issue. See + * errors for details. + * + * @return the failedPatchCount value. + */ + Integer failedPatchCount(); + + /** + * Gets the patches property: The patches that were installed during the operation. + * + * @return the patches value. + */ + List patches(); + + /** + * Gets the startDateTime property: The UTC timestamp when the operation began. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the error property: The errors that were encountered during execution of the operation. The details array + * contains the list of them. + * + * @return the error value. + */ + ApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstallPatchesResultInner + * object. + * + * @return the inner object. + */ + VirtualMachineInstallPatchesResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstanceView.java new file mode 100644 index 0000000000000..0bfc42e87ca17 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineInstanceView.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineInstanceView. */ +public interface VirtualMachineInstanceView { + /** + * Gets the platformUpdateDomain property: Specifies the update domain of the virtual machine. + * + * @return the platformUpdateDomain value. + */ + Integer platformUpdateDomain(); + + /** + * Gets the platformFaultDomain property: Specifies the fault domain of the virtual machine. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the computerName property: The computer name assigned to the virtual machine. + * + * @return the computerName value. + */ + String computerName(); + + /** + * Gets the osName property: The Operating System running on the virtual machine. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of Operating System running on the virtual machine. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the hyperVGeneration property: Specifies the HyperVGeneration Type associated with a resource. + * + * @return the hyperVGeneration value. + */ + HyperVGenerationType hyperVGeneration(); + + /** + * Gets the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @return the rdpThumbPrint value. + */ + String rdpThumbPrint(); + + /** + * Gets the vmAgent property: The VM Agent running on the virtual machine. + * + * @return the vmAgent value. + */ + VirtualMachineAgentInstanceView vmAgent(); + + /** + * Gets the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @return the maintenanceRedeployStatus value. + */ + MaintenanceRedeployStatus maintenanceRedeployStatus(); + + /** + * Gets the disks property: The virtual machine disk information. + * + * @return the disks value. + */ + List disks(); + + /** + * Gets the extensions property: The extensions information. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the vmHealth property: The health status for the VM. + * + * @return the vmHealth value. + */ + VirtualMachineHealthStatus vmHealth(); + + /** + * Gets the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console + * log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + BootDiagnosticsInstanceView bootDiagnostics(); + + /** + * Gets the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated + * through automatic placement, when the virtual machine is associated with a dedicated host group that has + * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. + * + * @return the assignedHost value. + */ + String assignedHost(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the patchStatus property: [Preview Feature] The status of virtual machine patch operations. + * + * @return the patchStatus value. + */ + VirtualMachinePatchStatus patchStatus(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInstanceViewInner object. + * + * @return the inner object. + */ + VirtualMachineInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java new file mode 100644 index 0000000000000..4252c6f084953 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineIpTag.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IP tag associated with the public IP address. */ +@Fluent +public final class VirtualMachineIpTag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineIpTag.class); + + /* + * IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * IP tag associated with the public IP. Example: SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the VirtualMachineIpTag object itself. + */ + public VirtualMachineIpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @param tag the tag value to set. + * @return the VirtualMachineIpTag object itself. + */ + public VirtualMachineIpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java new file mode 100644 index 0000000000000..6558fe4293311 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineListResult.class); + + /* + * The list of virtual machines. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of VMs. Call ListNext() with this URI to + * fetch the next page of Virtual Machines. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of virtual machines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machines. + * + * @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: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next + * page of Virtual Machines. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next + * page of Virtual Machines. + * + * @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) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VirtualMachineListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..40ec125b32841 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceConfiguration.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network interface configurations. */ +@JsonFlatten +@Fluent +public class VirtualMachineNetworkInterfaceConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineNetworkInterfaceConfiguration.class); + + /* + * The network interface configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the primary network interface in case the virtual machine has + * more than 1 network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /* + * Specifies whether the network interface is accelerated + * networking-enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "properties.enableFpga") + private Boolean enableFpga; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * The network security group. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * The dscpConfiguration property. + */ + @JsonProperty(value = "properties.dscpConfiguration") + private SubResource dscpConfiguration; + + /** + * Get the name property: The network interface configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The network interface configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.enableFpga; + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableFpga(Boolean enableFpga) { + this.enableFpga = enableFpga; + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDnsSettings( + VirtualMachineNetworkInterfaceDnsSettingsConfiguration dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the dscpConfiguration property: The dscpConfiguration property. + * + * @return the dscpConfiguration value. + */ + public SubResource dscpConfiguration() { + return this.dscpConfiguration; + } + + /** + * Set the dscpConfiguration property: The dscpConfiguration property. + * + * @param dscpConfiguration the dscpConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceConfiguration withDscpConfiguration(SubResource dscpConfiguration) { + this.dscpConfiguration = dscpConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineNetworkInterfaceConfiguration")); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java new file mode 100644 index 0000000000000..d6ebe8ba17c05 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceDnsSettingsConfiguration.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineNetworkInterfaceDnsSettingsConfiguration.class); + + /* + * List of DNS servers IP addresses + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the dnsServers property: List of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualMachineNetworkInterfaceDnsSettingsConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceDnsSettingsConfiguration withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..9128b361c6766 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineNetworkInterfaceIpConfiguration.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine network profile's IP configuration. */ +@JsonFlatten +@Fluent +public class VirtualMachineNetworkInterfaceIpConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineNetworkInterfaceIpConfiguration.class); + + /* + * The IP configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the identifier of the subnet. + */ + @JsonProperty(value = "properties.subnet") + private SubResource subnet; + + /* + * Specifies the primary network interface in case the virtual machine has + * more than 1 network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "properties.publicIPAddressConfiguration") + private VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration; + + /* + * Available from Api-Version 2017-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersions privateIpAddressVersion; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * Specifies an array of references to backend address pools of application + * gateways. A virtual machine can reference backend address pools of + * multiple application gateways. Multiple virtual machines cannot use the + * same application gateway. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to backend address pools of load + * balancers. A virtual machine can reference backend address pools of one + * public and one internal load balancer. [Multiple virtual machines cannot + * use the same basic sku load balancer]. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * Get the name property: The IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The IP configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.publicIpAddressConfiguration; + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPublicIpAddressConfiguration( + VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration) { + this.publicIpAddressConfiguration = publicIpAddressConfiguration; + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersions privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withPrivateIpAddressVersion( + IpVersions privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withApplicationSecurityGroups( + List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A virtual machine can reference backend address pools of multiple application gateways. + * Multiple virtual machines cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A virtual machine can reference backend address pools of one public and one internal load + * balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineNetworkInterfaceIpConfiguration object itself. + */ + public VirtualMachineNetworkInterfaceIpConfiguration withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineNetworkInterfaceIpConfiguration")); + } + if (publicIpAddressConfiguration() != null) { + publicIpAddressConfiguration().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.java new file mode 100644 index 0000000000000..79702ae297d59 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePatchStatus.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The status of virtual machine patch operations. */ +@Fluent +public final class VirtualMachinePatchStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinePatchStatus.class); + + /* + * The available patch summary of the latest assessment operation for the + * virtual machine. + */ + @JsonProperty(value = "availablePatchSummary") + private AvailablePatchSummary availablePatchSummary; + + /* + * The installation summary of the latest installation operation for the + * virtual machine. + */ + @JsonProperty(value = "lastPatchInstallationSummary") + private LastPatchInstallationSummary lastPatchInstallationSummary; + + /* + * The enablement status of the specified patchMode + */ + @JsonProperty(value = "configurationStatuses", access = JsonProperty.Access.WRITE_ONLY) + private List configurationStatuses; + + /** + * Get the availablePatchSummary property: The available patch summary of the latest assessment operation for the + * virtual machine. + * + * @return the availablePatchSummary value. + */ + public AvailablePatchSummary availablePatchSummary() { + return this.availablePatchSummary; + } + + /** + * Set the availablePatchSummary property: The available patch summary of the latest assessment operation for the + * virtual machine. + * + * @param availablePatchSummary the availablePatchSummary value to set. + * @return the VirtualMachinePatchStatus object itself. + */ + public VirtualMachinePatchStatus withAvailablePatchSummary(AvailablePatchSummary availablePatchSummary) { + this.availablePatchSummary = availablePatchSummary; + return this; + } + + /** + * Get the lastPatchInstallationSummary property: The installation summary of the latest installation operation for + * the virtual machine. + * + * @return the lastPatchInstallationSummary value. + */ + public LastPatchInstallationSummary lastPatchInstallationSummary() { + return this.lastPatchInstallationSummary; + } + + /** + * Set the lastPatchInstallationSummary property: The installation summary of the latest installation operation for + * the virtual machine. + * + * @param lastPatchInstallationSummary the lastPatchInstallationSummary value to set. + * @return the VirtualMachinePatchStatus object itself. + */ + public VirtualMachinePatchStatus withLastPatchInstallationSummary( + LastPatchInstallationSummary lastPatchInstallationSummary) { + this.lastPatchInstallationSummary = lastPatchInstallationSummary; + return this; + } + + /** + * Get the configurationStatuses property: The enablement status of the specified patchMode. + * + * @return the configurationStatuses value. + */ + public List configurationStatuses() { + return this.configurationStatuses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availablePatchSummary() != null) { + availablePatchSummary().validate(); + } + if (lastPatchInstallationSummary() != null) { + lastPatchInstallationSummary().validate(); + } + if (configurationStatuses() != null) { + configurationStatuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.java new file mode 100644 index 0000000000000..aac10be4bb6bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePriorityTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualMachinePriorityTypes. */ +public final class VirtualMachinePriorityTypes extends ExpandableStringEnum { + /** Static value Regular for VirtualMachinePriorityTypes. */ + public static final VirtualMachinePriorityTypes REGULAR = fromString("Regular"); + + /** Static value Low for VirtualMachinePriorityTypes. */ + public static final VirtualMachinePriorityTypes LOW = fromString("Low"); + + /** Static value Spot for VirtualMachinePriorityTypes. */ + public static final VirtualMachinePriorityTypes SPOT = fromString("Spot"); + + /** + * Creates or finds a VirtualMachinePriorityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachinePriorityTypes. + */ + @JsonCreator + public static VirtualMachinePriorityTypes fromString(String name) { + return fromString(name, VirtualMachinePriorityTypes.class); + } + + /** @return known VirtualMachinePriorityTypes values. */ + public static Collection values() { + return values(VirtualMachinePriorityTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java new file mode 100644 index 0000000000000..de9d47481d5fd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressConfiguration.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines IP Configuration's PublicIPAddress configuration. */ +@JsonFlatten +@Fluent +public class VirtualMachinePublicIpAddressConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinePublicIpAddressConfiguration.class); + + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes the public IP Sku + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Specify what happens to the public IP address when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IpVersions publicIpAddressVersion; + + /* + * Specify the public IP allocation type + */ + @JsonProperty(value = "properties.publicIPAllocationMethod") + private PublicIpAllocationMethod publicIpAllocationMethod; + + /** + * Get the name property: The publicIP address configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The publicIP address configuration name. + * + * @param name the name value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sku property: Describes the public IP Sku. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the public IP Sku. + * + * @param sku the sku value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP address when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withDnsSettings( + VirtualMachinePublicIpAddressDnsSettingsConfiguration dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipTags property: The list of IP tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.publicIpPrefix; + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersions publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpAddressVersion(IpVersions publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @return the publicIpAllocationMethod value. + */ + public PublicIpAllocationMethod publicIpAllocationMethod() { + return this.publicIpAllocationMethod; + } + + /** + * Set the publicIpAllocationMethod property: Specify the public IP allocation type. + * + * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. + * @return the VirtualMachinePublicIpAddressConfiguration object itself. + */ + public VirtualMachinePublicIpAddressConfiguration withPublicIpAllocationMethod( + PublicIpAllocationMethod publicIpAllocationMethod) { + this.publicIpAllocationMethod = publicIpAllocationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachinePublicIpAddressConfiguration")); + } + if (sku() != null) { + sku().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.java new file mode 100644 index 0000000000000..c1ed850e22121 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachinePublicIpAddressDnsSettingsConfiguration.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machines network configuration's DNS settings. */ +@Fluent +public final class VirtualMachinePublicIpAddressDnsSettingsConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachinePublicIpAddressDnsSettingsConfiguration.class); + + /* + * The Domain name label prefix of the PublicIPAddress resources that will + * be created. The generated name label is the concatenation of the domain + * name label and vm network profile unique ID. + */ + @JsonProperty(value = "domainNameLabel", required = true) + private String domainNameLabel; + + /** + * Get the domainNameLabel property: The Domain name label prefix of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The Domain name label prefix of the PublicIPAddress resources that will be + * created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the VirtualMachinePublicIpAddressDnsSettingsConfiguration object itself. + */ + public VirtualMachinePublicIpAddressDnsSettingsConfiguration withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainNameLabel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainNameLabel in model" + + " VirtualMachinePublicIpAddressDnsSettingsConfiguration")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.java new file mode 100644 index 0000000000000..63f6304c6adc3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineReimageParameters.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged. */ +@Fluent +public class VirtualMachineReimageParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineReimageParameters.class); + + /* + * Specifies whether to reimage temp disk. Default value: false. Note: This + * temp disk reimage parameter is only supported for VM/VMSS with Ephemeral + * OS disk. + */ + @JsonProperty(value = "tempDisk") + private Boolean tempDisk; + + /** + * Get the tempDisk property: Specifies whether to reimage temp disk. Default value: false. Note: This temp disk + * reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + * + * @return the tempDisk value. + */ + public Boolean tempDisk() { + return this.tempDisk; + } + + /** + * Set the tempDisk property: Specifies whether to reimage temp disk. Default value: false. Note: This temp disk + * reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + * + * @param tempDisk the tempDisk value to set. + * @return the VirtualMachineReimageParameters object itself. + */ + public VirtualMachineReimageParameters withTempDisk(Boolean tempDisk) { + this.tempDisk = tempDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java new file mode 100644 index 0000000000000..4b3222a16ec8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommand.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineRunCommand. */ +public interface VirtualMachineRunCommand { + /** + * 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 source property: The source of the run command script. + * + * @return the source value. + */ + VirtualMachineRunCommandScriptSource source(); + + /** + * Gets the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + List protectedParameters(); + + /** + * Gets the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script + * starts and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + Boolean asyncExecution(); + + /** + * Gets the runAsUser property: Specifies the user account on the VM when executing the run command. + * + * @return the runAsUser value. + */ + String runAsUser(); + + /** + * Gets the runAsPassword property: Specifies the user account password on the VM when executing the run command. + * + * @return the runAsPassword value. + */ + String runAsPassword(); + + /** + * Gets the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + Integer timeoutInSeconds(); + + /** + * Gets the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * + * @return the outputBlobUri value. + */ + String outputBlobUri(); + + /** + * Gets the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. + * + * @return the errorBlobUri value. + */ + String errorBlobUri(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The virtual machine run command instance view. + * + * @return the instanceView value. + */ + VirtualMachineRunCommandInstanceView instanceView(); + + /** + * 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.compute.generated.fluent.models.VirtualMachineRunCommandInner object. + * + * @return the inner object. + */ + VirtualMachineRunCommandInner innerModel(); + + /** The entirety of the VirtualMachineRunCommand definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The VirtualMachineRunCommand definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineRunCommand definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vmName. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @return the next definition stage. + */ + WithCreate withExistingVirtualMachine(String resourceGroupName, String vmName); + } + /** + * The stage of the VirtualMachineRunCommand 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.WithSource, + DefinitionStages.WithParameters, + DefinitionStages.WithProtectedParameters, + DefinitionStages.WithAsyncExecution, + DefinitionStages.WithRunAsUser, + DefinitionStages.WithRunAsPassword, + DefinitionStages.WithTimeoutInSeconds, + DefinitionStages.WithOutputBlobUri, + DefinitionStages.WithErrorBlobUri { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachineRunCommand create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachineRunCommand create(Context context); + } + /** The stage of the VirtualMachineRunCommand 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 VirtualMachineRunCommand definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source of the run command script.. + * + * @param source The source of the run command script. + * @return the next definition stage. + */ + WithCreate withSource(VirtualMachineRunCommandScriptSource source); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters used by the script.. + * + * @param parameters The parameters used by the script. + * @return the next definition stage. + */ + WithCreate withParameters(List parameters); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify protectedParameters. */ + interface WithProtectedParameters { + /** + * Specifies the protectedParameters property: The parameters used by the script.. + * + * @param protectedParameters The parameters used by the script. + * @return the next definition stage. + */ + WithCreate withProtectedParameters(List protectedParameters); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify asyncExecution. */ + interface WithAsyncExecution { + /** + * Specifies the asyncExecution property: Optional. If set to true, provisioning will complete as soon as + * the script starts and will not wait for script to complete.. + * + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts + * and will not wait for script to complete. + * @return the next definition stage. + */ + WithCreate withAsyncExecution(Boolean asyncExecution); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify runAsUser. */ + interface WithRunAsUser { + /** + * Specifies the runAsUser property: Specifies the user account on the VM when executing the run command.. + * + * @param runAsUser Specifies the user account on the VM when executing the run command. + * @return the next definition stage. + */ + WithCreate withRunAsUser(String runAsUser); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify runAsPassword. */ + interface WithRunAsPassword { + /** + * Specifies the runAsPassword property: Specifies the user account password on the VM when executing the + * run command.. + * + * @param runAsPassword Specifies the user account password on the VM when executing the run command. + * @return the next definition stage. + */ + WithCreate withRunAsPassword(String runAsPassword); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify timeoutInSeconds. */ + interface WithTimeoutInSeconds { + /** + * Specifies the timeoutInSeconds property: The timeout in seconds to execute the run command.. + * + * @param timeoutInSeconds The timeout in seconds to execute the run command. + * @return the next definition stage. + */ + WithCreate withTimeoutInSeconds(Integer timeoutInSeconds); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify outputBlobUri. */ + interface WithOutputBlobUri { + /** + * Specifies the outputBlobUri property: Specifies the Azure storage blob where script output stream will be + * uploaded.. + * + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded. + * @return the next definition stage. + */ + WithCreate withOutputBlobUri(String outputBlobUri); + } + /** The stage of the VirtualMachineRunCommand definition allowing to specify errorBlobUri. */ + interface WithErrorBlobUri { + /** + * Specifies the errorBlobUri property: Specifies the Azure storage blob where script error stream will be + * uploaded.. + * + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded. + * @return the next definition stage. + */ + WithCreate withErrorBlobUri(String errorBlobUri); + } + } + /** + * Begins update for the VirtualMachineRunCommand resource. + * + * @return the stage of resource update. + */ + VirtualMachineRunCommand.Update update(); + + /** The template for VirtualMachineRunCommand update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSource, + UpdateStages.WithParameters, + UpdateStages.WithProtectedParameters, + UpdateStages.WithAsyncExecution, + UpdateStages.WithRunAsUser, + UpdateStages.WithRunAsPassword, + UpdateStages.WithTimeoutInSeconds, + UpdateStages.WithOutputBlobUri, + UpdateStages.WithErrorBlobUri { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachineRunCommand apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachineRunCommand apply(Context context); + } + /** The VirtualMachineRunCommand update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachineRunCommand 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); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source of the run command script.. + * + * @param source The source of the run command script. + * @return the next definition stage. + */ + Update withSource(VirtualMachineRunCommandScriptSource source); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters used by the script.. + * + * @param parameters The parameters used by the script. + * @return the next definition stage. + */ + Update withParameters(List parameters); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify protectedParameters. */ + interface WithProtectedParameters { + /** + * Specifies the protectedParameters property: The parameters used by the script.. + * + * @param protectedParameters The parameters used by the script. + * @return the next definition stage. + */ + Update withProtectedParameters(List protectedParameters); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify asyncExecution. */ + interface WithAsyncExecution { + /** + * Specifies the asyncExecution property: Optional. If set to true, provisioning will complete as soon as + * the script starts and will not wait for script to complete.. + * + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts + * and will not wait for script to complete. + * @return the next definition stage. + */ + Update withAsyncExecution(Boolean asyncExecution); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify runAsUser. */ + interface WithRunAsUser { + /** + * Specifies the runAsUser property: Specifies the user account on the VM when executing the run command.. + * + * @param runAsUser Specifies the user account on the VM when executing the run command. + * @return the next definition stage. + */ + Update withRunAsUser(String runAsUser); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify runAsPassword. */ + interface WithRunAsPassword { + /** + * Specifies the runAsPassword property: Specifies the user account password on the VM when executing the + * run command.. + * + * @param runAsPassword Specifies the user account password on the VM when executing the run command. + * @return the next definition stage. + */ + Update withRunAsPassword(String runAsPassword); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify timeoutInSeconds. */ + interface WithTimeoutInSeconds { + /** + * Specifies the timeoutInSeconds property: The timeout in seconds to execute the run command.. + * + * @param timeoutInSeconds The timeout in seconds to execute the run command. + * @return the next definition stage. + */ + Update withTimeoutInSeconds(Integer timeoutInSeconds); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify outputBlobUri. */ + interface WithOutputBlobUri { + /** + * Specifies the outputBlobUri property: Specifies the Azure storage blob where script output stream will be + * uploaded.. + * + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded. + * @return the next definition stage. + */ + Update withOutputBlobUri(String outputBlobUri); + } + /** The stage of the VirtualMachineRunCommand update allowing to specify errorBlobUri. */ + interface WithErrorBlobUri { + /** + * Specifies the errorBlobUri property: Specifies the Azure storage blob where script error stream will be + * uploaded.. + * + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded. + * @return the next definition stage. + */ + Update withErrorBlobUri(String errorBlobUri); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineRunCommand refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineRunCommand refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandInstanceView.java new file mode 100644 index 0000000000000..751401d6ca58a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandInstanceView.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The instance view of a virtual machine run command. */ +@Fluent +public final class VirtualMachineRunCommandInstanceView { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandInstanceView.class); + + /* + * Script execution status. + */ + @JsonProperty(value = "executionState") + private ExecutionState executionState; + + /* + * Communicate script configuration errors or execution messages. + */ + @JsonProperty(value = "executionMessage") + private String executionMessage; + + /* + * Exit code returned from script execution. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /* + * Script output stream. + */ + @JsonProperty(value = "output") + private String output; + + /* + * Script error stream. + */ + @JsonProperty(value = "error") + private String error; + + /* + * Script start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Script end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the executionState property: Script execution status. + * + * @return the executionState value. + */ + public ExecutionState executionState() { + return this.executionState; + } + + /** + * Set the executionState property: Script execution status. + * + * @param executionState the executionState value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExecutionState(ExecutionState executionState) { + this.executionState = executionState; + return this; + } + + /** + * Get the executionMessage property: Communicate script configuration errors or execution messages. + * + * @return the executionMessage value. + */ + public String executionMessage() { + return this.executionMessage; + } + + /** + * Set the executionMessage property: Communicate script configuration errors or execution messages. + * + * @param executionMessage the executionMessage value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExecutionMessage(String executionMessage) { + this.executionMessage = executionMessage; + return this; + } + + /** + * Get the exitCode property: Exit code returned from script execution. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the exitCode property: Exit code returned from script execution. + * + * @param exitCode the exitCode value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the output property: Script output stream. + * + * @return the output value. + */ + public String output() { + return this.output; + } + + /** + * Set the output property: Script output stream. + * + * @param output the output value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withOutput(String output) { + this.output = output; + return this; + } + + /** + * Get the error property: Script error stream. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: Script error stream. + * + * @param error the error value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withError(String error) { + this.error = error; + return this; + } + + /** + * Get the startTime property: Script start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Script start time. + * + * @param startTime the startTime value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Script end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Script end time. + * + * @param endTime the endTime value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java new file mode 100644 index 0000000000000..0096650ef18b3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandScriptSource.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the script sources for run command. */ +@Fluent +public final class VirtualMachineRunCommandScriptSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandScriptSource.class); + + /* + * Specifies the script content to be executed on the VM. + */ + @JsonProperty(value = "script") + private String script; + + /* + * Specifies the script download location. + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /* + * Specifies a commandId of predefined built-in script. + */ + @JsonProperty(value = "commandId") + private String commandId; + + /** + * Get the script property: Specifies the script content to be executed on the VM. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: Specifies the script content to be executed on the VM. + * + * @param script the script value to set. + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withScript(String script) { + this.script = script; + return this; + } + + /** + * Get the scriptUri property: Specifies the script download location. + * + * @return the scriptUri value. + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set the scriptUri property: Specifies the script download location. + * + * @param scriptUri the scriptUri value to set. + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withScriptUri(String scriptUri) { + this.scriptUri = scriptUri; + return this; + } + + /** + * Get the commandId property: Specifies a commandId of predefined built-in script. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Set the commandId property: Specifies a commandId of predefined built-in script. + * + * @param commandId the commandId value to set. + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java new file mode 100644 index 0000000000000..f212257d7fa02 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandUpdate.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a Virtual Machine run command. */ +@JsonFlatten +@Fluent +public class VirtualMachineRunCommandUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandUpdate.class); + + /* + * The source of the run command script. + */ + @JsonProperty(value = "properties.source") + private VirtualMachineRunCommandScriptSource source; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /* + * The parameters used by the script. + */ + @JsonProperty(value = "properties.protectedParameters") + private List protectedParameters; + + /* + * Optional. If set to true, provisioning will complete as soon as the + * script starts and will not wait for script to complete. + */ + @JsonProperty(value = "properties.asyncExecution") + private Boolean asyncExecution; + + /* + * Specifies the user account on the VM when executing the run command. + */ + @JsonProperty(value = "properties.runAsUser") + private String runAsUser; + + /* + * Specifies the user account password on the VM when executing the run + * command. + */ + @JsonProperty(value = "properties.runAsPassword") + private String runAsPassword; + + /* + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "properties.timeoutInSeconds") + private Integer timeoutInSeconds; + + /* + * Specifies the Azure storage blob where script output stream will be + * uploaded. + */ + @JsonProperty(value = "properties.outputBlobUri") + private String outputBlobUri; + + /* + * Specifies the Azure storage blob where script error stream will be + * uploaded. + */ + @JsonProperty(value = "properties.errorBlobUri") + private String errorBlobUri; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine run command instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineRunCommandInstanceView instanceView; + + /** + * Get the source property: The source of the run command script. + * + * @return the source value. + */ + public VirtualMachineRunCommandScriptSource source() { + return this.source; + } + + /** + * Set the source property: The source of the run command script. + * + * @param source the source value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withSource(VirtualMachineRunCommandScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the parameters property: The parameters used by the script. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters used by the script. + * + * @param parameters the parameters value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the protectedParameters property: The parameters used by the script. + * + * @return the protectedParameters value. + */ + public List protectedParameters() { + return this.protectedParameters; + } + + /** + * Set the protectedParameters property: The parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withProtectedParameters(List protectedParameters) { + this.protectedParameters = protectedParameters; + return this; + } + + /** + * Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script + * starts and will not wait for script to complete. + * + * @return the asyncExecution value. + */ + public Boolean asyncExecution() { + return this.asyncExecution; + } + + /** + * Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script + * starts and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withAsyncExecution(Boolean asyncExecution) { + this.asyncExecution = asyncExecution; + return this; + } + + /** + * Get the runAsUser property: Specifies the user account on the VM when executing the run command. + * + * @return the runAsUser value. + */ + public String runAsUser() { + return this.runAsUser; + } + + /** + * Set the runAsUser property: Specifies the user account on the VM when executing the run command. + * + * @param runAsUser the runAsUser value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withRunAsUser(String runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get the runAsPassword property: Specifies the user account password on the VM when executing the run command. + * + * @return the runAsPassword value. + */ + public String runAsPassword() { + return this.runAsPassword; + } + + /** + * Set the runAsPassword property: Specifies the user account password on the VM when executing the run command. + * + * @param runAsPassword the runAsPassword value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withRunAsPassword(String runAsPassword) { + this.runAsPassword = runAsPassword; + return this; + } + + /** + * Get the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * + * @return the outputBlobUri value. + */ + public String outputBlobUri() { + return this.outputBlobUri; + } + + /** + * Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. + * + * @param outputBlobUri the outputBlobUri value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. + * + * @return the errorBlobUri value. + */ + public String errorBlobUri() { + return this.errorBlobUri; + } + + /** + * Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. + * + * @param errorBlobUri the errorBlobUri value to set. + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine run command instance view. + * + * @return the instanceView value. + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.instanceView; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineRunCommandUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (source() != null) { + source().validate(); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (protectedParameters() != null) { + protectedParameters().forEach(e -> e.validate()); + } + if (instanceView() != null) { + instanceView().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommands.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommands.java new file mode 100644 index 0000000000000..95010a6e234e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommands.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.compute.generated.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 VirtualMachineRunCommands. */ +public interface VirtualMachineRunCommands { + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable list(String location); + + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable list(String location, Context context); + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command 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 specific run command for a subscription in a location. + */ + RunCommandDocument get(String location, String commandId); + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command 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 specific run command for a subscription in a location. + */ + Response getWithResponse(String location, String commandId, Context context); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmName, String runCommandName); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmName, String runCommandName, Context context); + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand getByVirtualMachine(String resourceGroupName, String vmName, String runCommandName); + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + Response getByVirtualMachineWithResponse( + String resourceGroupName, String vmName, String runCommandName, String expand, Context context); + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + PagedIterable listByVirtualMachine(String resourceGroupName, String vmName); + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + PagedIterable listByVirtualMachine( + String resourceGroupName, String vmName, String expand, Context context); + + /** + * The operation to get the run command. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand getById(String id); + + /** + * The operation to get the run command. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * The operation to delete the run command. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete the run command. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new VirtualMachineRunCommand resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineRunCommand definition. + */ + VirtualMachineRunCommand.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.java new file mode 100644 index 0000000000000..840086be92935 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineRunCommandsListResult.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List run command operation response. */ +@Fluent +public final class VirtualMachineRunCommandsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsListResult.class); + + /* + * The list of run commands + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of run commands. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of run commands. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of run commands. + * + * @param value the value value to set. + * @return the VirtualMachineRunCommandsListResult object itself. + */ + public VirtualMachineRunCommandsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of run commands. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of run commands. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineRunCommandsListResult object itself. + */ + public VirtualMachineRunCommandsListResult 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 VirtualMachineRunCommandsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java new file mode 100644 index 0000000000000..a1d7be17f0f76 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java @@ -0,0 +1,1121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineScaleSet. */ +public interface VirtualMachineScaleSet { + /** + * 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 sku property: The virtual machine scale set sku. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the plan property: Specifies information about the marketplace image used to create the virtual machine. + * This element is only used for marketplace images. Before you can use a marketplace image from an API, you must + * enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and + * then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the identity property: The identity of the virtual machine scale set, if configured. + * + * @return the identity value. + */ + VirtualMachineScaleSetIdentity identity(); + + /** + * Gets the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be set when you + * create the scale set. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine Scale Set. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the upgradePolicy property: The upgrade policy. + * + * @return the upgradePolicy value. + */ + UpgradePolicy upgradePolicy(); + + /** + * Gets the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @return the automaticRepairsPolicy value. + */ + AutomaticRepairsPolicy automaticRepairsPolicy(); + + /** + * Gets the virtualMachineProfile property: The virtual machine profile. + * + * @return the virtualMachineProfile value. + */ + VirtualMachineScaleSetVMProfile virtualMachineProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @return the overprovision value. + */ + Boolean overprovision(); + + /** + * Gets the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched + * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions + * do not run on the extra overprovisioned VMs. + * + * @return the doNotRunExtensionsOnOverprovisionedVMs value. + */ + Boolean doNotRunExtensionsOnOverprovisionedVMs(); + + /** + * Gets the uniqueId property: Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * + * @return the singlePlacementGroup value. + */ + Boolean singlePlacementGroup(); + + /** + * Gets the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. + * + * @return the zoneBalance value. + */ + Boolean zoneBalance(); + + /** + * Gets the platformFaultDomainCount property: Fault Domain count for each placement group. + * + * @return the platformFaultDomainCount value. + */ + Integer platformFaultDomainCount(); + + /** + * Gets the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the hostGroup property: Specifies information about the dedicated host group that the virtual machine scale + * set resides in. <br><br>Minimum api-version: 2020-06-01. + * + * @return the hostGroup value. + */ + SubResource hostGroup(); + + /** + * Gets the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * + * @return the additionalCapabilities value. + */ + AdditionalCapabilities additionalCapabilities(); + + /** + * Gets the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * + * @return the scaleInPolicy value. + */ + ScaleInPolicy scaleInPolicy(); + + /** + * Gets the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale set. + * + * @return the orchestrationMode value. + */ + OrchestrationMode orchestrationMode(); + + /** + * Gets the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine scale set. + * + * @return the spotRestorePolicy value. + */ + SpotRestorePolicy spotRestorePolicy(); + + /** + * 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.compute.generated.fluent.models.VirtualMachineScaleSetInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetInner innerModel(); + + /** The entirety of the VirtualMachineScaleSet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualMachineScaleSet definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineScaleSet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachineScaleSet 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 VirtualMachineScaleSet definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualMachineScaleSet 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.WithSku, + DefinitionStages.WithPlan, + DefinitionStages.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithUpgradePolicy, + DefinitionStages.WithAutomaticRepairsPolicy, + DefinitionStages.WithVirtualMachineProfile, + DefinitionStages.WithOverprovision, + DefinitionStages.WithDoNotRunExtensionsOnOverprovisionedVMs, + DefinitionStages.WithSinglePlacementGroup, + DefinitionStages.WithZoneBalance, + DefinitionStages.WithPlatformFaultDomainCount, + DefinitionStages.WithProximityPlacementGroup, + DefinitionStages.WithHostGroup, + DefinitionStages.WithAdditionalCapabilities, + DefinitionStages.WithScaleInPolicy, + DefinitionStages.WithOrchestrationMode, + DefinitionStages.WithSpotRestorePolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachineScaleSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachineScaleSet create(Context context); + } + /** The stage of the VirtualMachineScaleSet 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 VirtualMachineScaleSet definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The virtual machine scale set sku.. + * + * @param sku The virtual machine scale set sku. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: Specifies information about the marketplace image used to create the virtual + * machine. This element is only used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that + * you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**.. + * + * @param plan Specifies information about the marketplace image used to create the virtual machine. This + * element is only used for marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the marketplace image that you + * want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required + * information and then click **Save**. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the virtual machine scale set, if configured.. + * + * @param identity The identity of the virtual machine scale set, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(VirtualMachineScaleSetIdentity identity); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: The virtual machine scale set zones. NOTE: Availability zones can only be + * set when you create the scale set. + * + * @param zones The virtual machine scale set zones. NOTE: Availability zones can only be set when you + * create the scale set. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Virtual Machine Scale Set.. + * + * @param extendedLocation The extended location of the Virtual Machine Scale Set. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify upgradePolicy. */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: The upgrade policy.. + * + * @param upgradePolicy The upgrade policy. + * @return the next definition stage. + */ + WithCreate withUpgradePolicy(UpgradePolicy upgradePolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify automaticRepairsPolicy. */ + interface WithAutomaticRepairsPolicy { + /** + * Specifies the automaticRepairsPolicy property: Policy for automatic repairs.. + * + * @param automaticRepairsPolicy Policy for automatic repairs. + * @return the next definition stage. + */ + WithCreate withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify virtualMachineProfile. */ + interface WithVirtualMachineProfile { + /** + * Specifies the virtualMachineProfile property: The virtual machine profile.. + * + * @param virtualMachineProfile The virtual machine profile. + * @return the next definition stage. + */ + WithCreate withVirtualMachineProfile(VirtualMachineScaleSetVMProfile virtualMachineProfile); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify overprovision. */ + interface WithOverprovision { + /** + * Specifies the overprovision property: Specifies whether the Virtual Machine Scale Set should be + * overprovisioned.. + * + * @param overprovision Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * @return the next definition stage. + */ + WithCreate withOverprovision(Boolean overprovision); + } + /** + * The stage of the VirtualMachineScaleSet definition allowing to specify + * doNotRunExtensionsOnOverprovisionedVMs. + */ + interface WithDoNotRunExtensionsOnOverprovisionedVMs { + /** + * Specifies the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions + * are launched only on the requested number of VMs which are finally kept. This property will hence ensure + * that the extensions do not run on the extra overprovisioned VMs.. + * + * @param doNotRunExtensionsOnOverprovisionedVMs When Overprovision is enabled, extensions are launched only + * on the requested number of VMs which are finally kept. This property will hence ensure that the + * extensions do not run on the extra overprovisioned VMs. + * @return the next definition stage. + */ + WithCreate withDoNotRunExtensionsOnOverprovisionedVMs(Boolean doNotRunExtensionsOnOverprovisionedVMs); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify singlePlacementGroup. */ + interface WithSinglePlacementGroup { + /** + * Specifies the singlePlacementGroup property: When true this limits the scale set to a single placement + * group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + * false. However, if singlePlacementGroup is false, it may not be modified to true.. + * + * @param singlePlacementGroup When true this limits the scale set to a single placement group, of max size + * 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * @return the next definition stage. + */ + WithCreate withSinglePlacementGroup(Boolean singlePlacementGroup); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify zoneBalance. */ + interface WithZoneBalance { + /** + * Specifies the zoneBalance property: Whether to force strictly even Virtual Machine distribution cross + * x-zones in case there is zone outage.. + * + * @param zoneBalance Whether to force strictly even Virtual Machine distribution cross x-zones in case + * there is zone outage. + * @return the next definition stage. + */ + WithCreate withZoneBalance(Boolean zoneBalance); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify platformFaultDomainCount. */ + interface WithPlatformFaultDomainCount { + /** + * Specifies the platformFaultDomainCount property: Fault Domain count for each placement group.. + * + * @param platformFaultDomainCount Fault Domain count for each placement group. + * @return the next definition stage. + */ + WithCreate withPlatformFaultDomainCount(Integer platformFaultDomainCount); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: + * 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify hostGroup. */ + interface WithHostGroup { + /** + * Specifies the hostGroup property: Specifies information about the dedicated host group that the virtual + * machine scale set resides in. <br><br>Minimum api-version: 2020-06-01.. + * + * @param hostGroup Specifies information about the dedicated host group that the virtual machine scale set + * resides in. <br><br>Minimum api-version: 2020-06-01. + * @return the next definition stage. + */ + WithCreate withHostGroup(SubResource hostGroup); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Specifies additional capabilities enabled or disabled on + * the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have + * the capability to support attaching managed data disks with UltraSSD_LRS storage account type.. + * + * @param additionalCapabilities Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the + * capability to support attaching managed data disks with UltraSSD_LRS storage account type. + * @return the next definition stage. + */ + WithCreate withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify scaleInPolicy. */ + interface WithScaleInPolicy { + /** + * Specifies the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines + * are chosen for removal when a Virtual Machine Scale Set is scaled-in.. + * + * @param scaleInPolicy Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * @return the next definition stage. + */ + WithCreate withScaleInPolicy(ScaleInPolicy scaleInPolicy); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify orchestrationMode. */ + interface WithOrchestrationMode { + /** + * Specifies the orchestrationMode property: Specifies the orchestration mode for the virtual machine scale + * set.. + * + * @param orchestrationMode Specifies the orchestration mode for the virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withOrchestrationMode(OrchestrationMode orchestrationMode); + } + /** The stage of the VirtualMachineScaleSet definition allowing to specify spotRestorePolicy. */ + interface WithSpotRestorePolicy { + /** + * Specifies the spotRestorePolicy property: Specifies the Spot Restore properties for the virtual machine + * scale set.. + * + * @param spotRestorePolicy Specifies the Spot Restore properties for the virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withSpotRestorePolicy(SpotRestorePolicy spotRestorePolicy); + } + } + /** + * Begins update for the VirtualMachineScaleSet resource. + * + * @return the stage of resource update. + */ + VirtualMachineScaleSet.Update update(); + + /** The template for VirtualMachineScaleSet update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithPlan, + UpdateStages.WithIdentity, + UpdateStages.WithUpgradePolicy, + UpdateStages.WithAutomaticRepairsPolicy, + UpdateStages.WithVirtualMachineProfile, + UpdateStages.WithOverprovision, + UpdateStages.WithDoNotRunExtensionsOnOverprovisionedVMs, + UpdateStages.WithSinglePlacementGroup, + UpdateStages.WithAdditionalCapabilities, + UpdateStages.WithScaleInPolicy, + UpdateStages.WithProximityPlacementGroup { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachineScaleSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachineScaleSet apply(Context context); + } + /** The VirtualMachineScaleSet update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachineScaleSet 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); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The virtual machine scale set sku.. + * + * @param sku The virtual machine scale set sku. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: The purchase plan when deploying a virtual machine scale set from VM + * Marketplace images.. + * + * @param plan The purchase plan when deploying a virtual machine scale set from VM Marketplace images. + * @return the next definition stage. + */ + Update withPlan(Plan plan); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the virtual machine scale set, if configured.. + * + * @param identity The identity of the virtual machine scale set, if configured. + * @return the next definition stage. + */ + Update withIdentity(VirtualMachineScaleSetIdentity identity); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify upgradePolicy. */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: The upgrade policy.. + * + * @param upgradePolicy The upgrade policy. + * @return the next definition stage. + */ + Update withUpgradePolicy(UpgradePolicy upgradePolicy); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify automaticRepairsPolicy. */ + interface WithAutomaticRepairsPolicy { + /** + * Specifies the automaticRepairsPolicy property: Policy for automatic repairs.. + * + * @param automaticRepairsPolicy Policy for automatic repairs. + * @return the next definition stage. + */ + Update withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify virtualMachineProfile. */ + interface WithVirtualMachineProfile { + /** + * Specifies the virtualMachineProfile property: The virtual machine profile.. + * + * @param virtualMachineProfile The virtual machine profile. + * @return the next definition stage. + */ + Update withVirtualMachineProfile(VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify overprovision. */ + interface WithOverprovision { + /** + * Specifies the overprovision property: Specifies whether the Virtual Machine Scale Set should be + * overprovisioned.. + * + * @param overprovision Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * @return the next definition stage. + */ + Update withOverprovision(Boolean overprovision); + } + /** + * The stage of the VirtualMachineScaleSet update allowing to specify doNotRunExtensionsOnOverprovisionedVMs. + */ + interface WithDoNotRunExtensionsOnOverprovisionedVMs { + /** + * Specifies the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions + * are launched only on the requested number of VMs which are finally kept. This property will hence ensure + * that the extensions do not run on the extra overprovisioned VMs.. + * + * @param doNotRunExtensionsOnOverprovisionedVMs When Overprovision is enabled, extensions are launched only + * on the requested number of VMs which are finally kept. This property will hence ensure that the + * extensions do not run on the extra overprovisioned VMs. + * @return the next definition stage. + */ + Update withDoNotRunExtensionsOnOverprovisionedVMs(Boolean doNotRunExtensionsOnOverprovisionedVMs); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify singlePlacementGroup. */ + interface WithSinglePlacementGroup { + /** + * Specifies the singlePlacementGroup property: When true this limits the scale set to a single placement + * group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to + * false. However, if singlePlacementGroup is false, it may not be modified to true.. + * + * @param singlePlacementGroup When true this limits the scale set to a single placement group, of max size + * 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * @return the next definition stage. + */ + Update withSinglePlacementGroup(Boolean singlePlacementGroup); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: Specifies additional capabilities enabled or disabled on + * the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have + * the capability to support attaching managed data disks with UltraSSD_LRS storage account type.. + * + * @param additionalCapabilities Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the + * capability to support attaching managed data disks with UltraSSD_LRS storage account type. + * @return the next definition stage. + */ + Update withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify scaleInPolicy. */ + interface WithScaleInPolicy { + /** + * Specifies the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines + * are chosen for removal when a Virtual Machine Scale Set is scaled-in.. + * + * @param scaleInPolicy Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * @return the next definition stage. + */ + Update withScaleInPolicy(ScaleInPolicy scaleInPolicy); + } + /** The stage of the VirtualMachineScaleSet update allowing to specify proximityPlacementGroup. */ + interface WithProximityPlacementGroup { + /** + * Specifies the proximityPlacementGroup property: Specifies information about the proximity placement group + * that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: + * 2018-04-01.. + * + * @param proximityPlacementGroup Specifies information about the proximity placement group that the virtual + * machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * @return the next definition stage. + */ + Update withProximityPlacementGroup(SubResource proximityPlacementGroup); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineScaleSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineScaleSet refresh(Context context); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @throws com.azure.core.management.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 deallocate(); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances( + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Boolean forceDeletion, Context context); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @throws com.azure.core.management.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 powerOff(); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(Boolean skipShutdown, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @throws com.azure.core.management.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(); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @throws com.azure.core.management.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(); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @throws com.azure.core.management.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 performMaintenance(); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 performMaintenance(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateInstances(VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, Context context); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @throws com.azure.core.management.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 reimage(); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, Context context); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @throws com.azure.core.management.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 reimageAll(); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimageAll(VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 convertToSinglePlacementGroup(VMScaleSetConvertToSinglePlacementGroupInput parameters); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response convertToSinglePlacementGroupWithResponse( + VMScaleSetConvertToSinglePlacementGroupInput parameters, Context context); + + /** + * Changes ServiceState property for a given service. + * + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState(OrchestrationServiceStateInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState(OrchestrationServiceStateInput parameters, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java new file mode 100644 index 0000000000000..9d3a2af9dd9c1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetDataDisk.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set data disk. */ +@Fluent +public final class VirtualMachineScaleSetDataDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetDataDisk.class); + + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /* + * Specifies the caching requirements.

    Possible values are: + *

    **None**

    **ReadOnly**

    **ReadWrite**

    + * Default: **None for Standard storage. ReadOnly for Premium storage** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * The create option. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can + * be used to overwrite the size of the disk in a virtual machine image. + *

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private VirtualMachineScaleSetManagedDiskParameters managedDisk; + + /* + * Specifies the Read-Write IOPS for the managed disk. Should be used only + * when StorageAccountType is UltraSSD_LRS. If not specified, a default + * value would be assigned based on diskSizeGB. + */ + @JsonProperty(value = "diskIOPSReadWrite") + private Long diskIopsReadWrite; + + /* + * Specifies the bandwidth in MB per second for the managed disk. Should be + * used only when StorageAccountType is UltraSSD_LRS. If not specified, a + * default value would be assigned based on diskSizeGB. + */ + @JsonProperty(value = "diskMBpsReadWrite") + private Long diskMBpsReadWrite; + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @param lun the lun value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withLun(int lun) { + this.lun = lun; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @param caching the caching value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the createOption property: The create option. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: The create option. + * + * @param createOption the createOption value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than + * 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public VirtualMachineScaleSetManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when + * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Set the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when + * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + * + * @param diskIopsReadWrite the diskIopsReadWrite value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskIopsReadWrite(Long diskIopsReadWrite) { + this.diskIopsReadWrite = diskIopsReadWrite; + return this; + } + + /** + * Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used + * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on + * diskSizeGB. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Set the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used + * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on + * diskSizeGB. + * + * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + this.diskMBpsReadWrite = diskMBpsReadWrite; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property createOption in model VirtualMachineScaleSetDataDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java new file mode 100644 index 0000000000000..3af78c11ce8f3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtension.java @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineScaleSetExtension. */ +public interface VirtualMachineScaleSetExtension { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the extension. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Object settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + List provisionAfterExtensions(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner + * object. + * + * @return the inner object. + */ + VirtualMachineScaleSetExtensionInner innerModel(); + + /** The entirety of the VirtualMachineScaleSetExtension definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualMachineScaleSetExtension definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineScaleSetExtension definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vmScaleSetName. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @return the next definition stage. + */ + WithCreate withExistingVirtualMachineScaleSet(String resourceGroupName, String vmScaleSetName); + } + /** + * The stage of the VirtualMachineScaleSetExtension 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.WithName, + DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithProvisionAfterExtensions { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachineScaleSetExtension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachineScaleSetExtension create(Context context); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the extension.. + * + * @param name The name of the extension. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: If a value is provided and is different from the previous value, + * the extension handler will be forced to update even if the extension configuration has not changed.. + * + * @param forceUpdateTag If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Object settings); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + /** The stage of the VirtualMachineScaleSetExtension definition allowing to specify provisionAfterExtensions. */ + interface WithProvisionAfterExtensions { + /** + * Specifies the provisionAfterExtensions property: Collection of extension names after which this extension + * needs to be provisioned.. + * + * @param provisionAfterExtensions Collection of extension names after which this extension needs to be + * provisioned. + * @return the next definition stage. + */ + WithCreate withProvisionAfterExtensions(List provisionAfterExtensions); + } + } + /** + * Begins update for the VirtualMachineScaleSetExtension resource. + * + * @return the stage of resource update. + */ + VirtualMachineScaleSetExtension.Update update(); + + /** The template for VirtualMachineScaleSetExtension update. */ + interface Update + extends UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings, + UpdateStages.WithProvisionAfterExtensions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachineScaleSetExtension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachineScaleSetExtension apply(Context context); + } + /** The VirtualMachineScaleSetExtension update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: If a value is provided and is different from the previous value, + * the extension handler will be forced to update even if the extension configuration has not changed.. + * + * @param forceUpdateTag If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withTypePropertiesType(String typePropertiesType); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Object settings); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + Update withProtectedSettings(Object protectedSettings); + } + /** The stage of the VirtualMachineScaleSetExtension update allowing to specify provisionAfterExtensions. */ + interface WithProvisionAfterExtensions { + /** + * Specifies the provisionAfterExtensions property: Collection of extension names after which this extension + * needs to be provisioned.. + * + * @param provisionAfterExtensions Collection of extension names after which this extension needs to be + * provisioned. + * @return the next definition stage. + */ + Update withProvisionAfterExtensions(List provisionAfterExtensions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineScaleSetExtension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineScaleSetExtension refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.java new file mode 100644 index 0000000000000..36bc7d926bcd5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List VM scale set extension operation response. */ +@Fluent +public final class VirtualMachineScaleSetExtensionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionListResult.class); + + /* + * The list of VM scale set extensions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of VM scale set extensions. Call + * ListNext() with this to fetch the next page of VM scale set extensions. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of VM scale set extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VM scale set extensions. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetExtensionListResult object itself. + */ + public VirtualMachineScaleSetExtensionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of VM scale set extensions. Call ListNext() with this + * to fetch the next page of VM scale set extensions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of VM scale set extensions. Call ListNext() with this + * to fetch the next page of VM scale set extensions. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetExtensionListResult object itself. + */ + public VirtualMachineScaleSetExtensionListResult 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 VirtualMachineScaleSetExtensionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.java new file mode 100644 index 0000000000000..b09865dece416 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionProfile.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set extension profile. */ +@Fluent +public final class VirtualMachineScaleSetExtensionProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionProfile.class); + + /* + * The virtual machine scale set child extension resources. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * Specifies the time alloted for all extensions to start. The time + * duration should be between 15 minutes and 120 minutes (inclusive) and + * should be specified in ISO 8601 format. The default value is 90 minutes + * (PT1H30M).

    Minimum api-version: 2020-06-01 + */ + @JsonProperty(value = "extensionsTimeBudget") + private String extensionsTimeBudget; + + /** + * Get the extensions property: The virtual machine scale set child extension resources. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The virtual machine scale set child extension resources. + * + * @param extensions the extensions value to set. + * @return the VirtualMachineScaleSetExtensionProfile object itself. + */ + public VirtualMachineScaleSetExtensionProfile withExtensions( + List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.extensionsTimeBudget; + } + + /** + * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineScaleSetExtensionProfile object itself. + */ + public VirtualMachineScaleSetExtensionProfile withExtensionsTimeBudget(String extensionsTimeBudget) { + this.extensionsTimeBudget = extensionsTimeBudget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java new file mode 100644 index 0000000000000..fa210d4de1e53 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensionUpdate.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionUpdate.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * If a value is provided and is different from the previous value, the + * extension handler will be forced to update even if the extension + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Collection of extension names after which this extension needs to be + * provisioned. + */ + @JsonProperty(value = "properties.provisionAfterExtensions") + private List provisionAfterExtensions; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineScaleSetExtensionUpdate object itself. + */ + public VirtualMachineScaleSetExtensionUpdate withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.java new file mode 100644 index 0000000000000..5749048e6aa0a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetExtensions.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 VirtualMachineScaleSetExtensions. */ +public interface VirtualMachineScaleSetExtensions { + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String vmssExtensionName); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String vmssExtensionName, Context context); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + VirtualMachineScaleSetExtension get(String resourceGroupName, String vmScaleSetName, String vmssExtensionName); + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context); + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + PagedIterable list(String resourceGroupName, String vmScaleSetName); + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all extensions in a VM scale set. + */ + PagedIterable list( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * The operation to get the extension. + * + * @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 describes a Virtual Machine Scale Set Extension. + */ + VirtualMachineScaleSetExtension getById(String id); + + /** + * The operation to get the extension. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set Extension. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * The operation to delete the extension. + * + * @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); + + /** + * The operation to delete the extension. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualMachineScaleSetExtension resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineScaleSetExtension definition. + */ + VirtualMachineScaleSetExtension.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentity.java new file mode 100644 index 0000000000000..9e2a9263805d1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentity.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the virtual machine scale set. */ +@Fluent +public class VirtualMachineScaleSetIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIdentity.class); + + /* + * The principal id of virtual machine scale set identity. This property + * will only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id associated with the virtual machine scale set. This + * property will only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the virtual machine scale set. The type + * 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the virtual machine scale set. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the virtual machine scale + * set. The user identity dictionary key references will be ARM resource + * ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of virtual machine scale set identity. This property will only be + * provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the virtual machine scale set. This property will only + * be provided for a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the virtual machine scale set. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' + * will remove any identities from the virtual machine scale set. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the virtual machine scale set. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' + * will remove any identities from the virtual machine scale set. + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetIdentity object itself. + */ + public VirtualMachineScaleSetIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the virtual machine scale + * set. The user identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the virtual machine scale + * set. The user identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the VirtualMachineScaleSetIdentity object itself. + */ + public VirtualMachineScaleSetIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..3e74509b5dd5b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue model. */ +@Immutable +public final class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceView.java new file mode 100644 index 0000000000000..59483979049e0 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceView.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineScaleSetInstanceView. */ +public interface VirtualMachineScaleSetInstanceView { + /** + * Gets the virtualMachine property: The instance view status summary for the virtual machine scale set. + * + * @return the virtualMachine value. + */ + VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine(); + + /** + * Gets the extensions property: The extensions information. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the orchestrationServices property: The orchestration services information. + * + * @return the orchestrationServices value. + */ + List orchestrationServices(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInstanceViewInner + * object. + * + * @return the inner object. + */ + VirtualMachineScaleSetInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java new file mode 100644 index 0000000000000..2f1c5e861f7f4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Instance view statuses summary for virtual machines of a virtual machine scale set. */ +@Immutable +public final class VirtualMachineScaleSetInstanceViewStatusesSummary { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetInstanceViewStatusesSummary.class); + + /* + * The extensions information. + */ + @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) + private List statusesSummary; + + /** + * Get the statusesSummary property: The extensions information. + * + * @return the statusesSummary value. + */ + public List statusesSummary() { + return this.statusesSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusesSummary() != null) { + statusesSummary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpConfiguration.java new file mode 100644 index 0000000000000..d25199ec6ac01 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpConfiguration.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's IP configuration. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIpConfiguration.class); + + /* + * The IP configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the identifier of the subnet. + */ + @JsonProperty(value = "properties.subnet") + private ApiEntityReference subnet; + + /* + * Specifies the primary network interface in case the virtual machine has + * more than 1 network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "properties.publicIPAddressConfiguration") + private VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration; + + /* + * Available from Api-Version 2017-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * Specifies an array of references to backend address pools of application + * gateways. A scale set can reference backend address pools of multiple + * application gateways. Multiple scale sets cannot use the same + * application gateway. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * Specifies an array of references to backend address pools of load + * balancers. A scale set can reference backend address pools of one public + * and one internal load balancer. Multiple scale sets cannot use the same + * basic sku load balancer. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and + * one internal load balancer. Multiple scale sets cannot use the same + * basic sku load balancer. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatPools") + private List loadBalancerInboundNatPools; + + /** + * Get the name property: The IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The IP configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withSubnet(ApiEntityReference subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.publicIpAddressConfiguration; + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPublicIpAddressConfiguration( + VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { + this.publicIpAddressConfiguration = publicIpAddressConfiguration; + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withApplicationSecurityGroups( + List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerInboundNatPools value. + */ + public List loadBalancerInboundNatPools() { + return this.loadBalancerInboundNatPools; + } + + /** + * Set the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withLoadBalancerInboundNatPools( + List loadBalancerInboundNatPools) { + this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetIpConfiguration")); + } + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddressConfiguration() != null) { + publicIpAddressConfiguration().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpTag.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpTag.java new file mode 100644 index 0000000000000..91acf834f22d8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetIpTag.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IP tag associated with the public IP address. */ +@Fluent +public final class VirtualMachineScaleSetIpTag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetIpTag.class); + + /* + * IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * IP tag associated with the public IP. Example: SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @param tag the tag value to set. + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListOSUpgradeHistory.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListOSUpgradeHistory.java new file mode 100644 index 0000000000000..798483eb81bbe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListOSUpgradeHistory.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.UpgradeOperationHistoricalStatusInfoInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Virtual Machine Scale Set OS Upgrade History operation response. */ +@Fluent +public final class VirtualMachineScaleSetListOSUpgradeHistory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListOSUpgradeHistory.class); + + /* + * The list of OS upgrades performed on the virtual machine scale set. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of OS Upgrade History. Call ListNext() + * with this to fetch the next page of history of upgrades. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of OS upgrades performed on the virtual machine scale set. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of OS upgrades performed on the virtual machine scale set. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetListOSUpgradeHistory object itself. + */ + public VirtualMachineScaleSetListOSUpgradeHistory withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to + * fetch the next page of history of upgrades. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to + * fetch the next page of history of upgrades. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetListOSUpgradeHistory object itself. + */ + public VirtualMachineScaleSetListOSUpgradeHistory 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 VirtualMachineScaleSetListOSUpgradeHistory")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListResult.java new file mode 100644 index 0000000000000..718cb4a300859 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineScaleSetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListResult.class); + + /* + * The list of virtual machine scale sets. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Virtual Machine Scale Sets. Call + * ListNext() with this to fetch the next page of VMSS. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of virtual machine scale sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine scale sets. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetListResult object itself. + */ + public VirtualMachineScaleSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with + * this to fetch the next page of VMSS. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with + * this to fetch the next page of VMSS. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetListResult object itself. + */ + public VirtualMachineScaleSetListResult 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 VirtualMachineScaleSetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListSkusResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListSkusResult.java new file mode 100644 index 0000000000000..036895a5f63bf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListSkusResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Virtual Machine Scale Set List Skus operation response. */ +@Fluent +public final class VirtualMachineScaleSetListSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListSkusResult.class); + + /* + * The list of skus available for the virtual machine scale set. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Virtual Machine Scale Set Skus. Call + * ListNext() with this to fetch the next page of VMSS Skus. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of skus available for the virtual machine scale set. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of skus available for the virtual machine scale set. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetListSkusResult object itself. + */ + public VirtualMachineScaleSetListSkusResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with + * this to fetch the next page of VMSS Skus. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with + * this to fetch the next page of VMSS Skus. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetListSkusResult object itself. + */ + public VirtualMachineScaleSetListSkusResult 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 VirtualMachineScaleSetListSkusResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListWithLinkResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListWithLinkResult.java new file mode 100644 index 0000000000000..94bd1d0cbe98e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetListWithLinkResult.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineScaleSetListWithLinkResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetListWithLinkResult.class); + + /* + * The list of virtual machine scale sets. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Virtual Machine Scale Sets. Call + * ListNext() with this to fetch the next page of Virtual Machine Scale + * Sets. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of virtual machine scale sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine scale sets. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetListWithLinkResult object itself. + */ + public VirtualMachineScaleSetListWithLinkResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with + * this to fetch the next page of Virtual Machine Scale Sets. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with + * this to fetch the next page of Virtual Machine Scale Sets. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetListWithLinkResult object itself. + */ + public VirtualMachineScaleSetListWithLinkResult 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 VirtualMachineScaleSetListWithLinkResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetManagedDiskParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetManagedDiskParameters.java new file mode 100644 index 0000000000000..e17a0a6d40b4b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetManagedDiskParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters of a ScaleSet managed disk. */ +@Fluent +public final class VirtualMachineScaleSetManagedDiskParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetManagedDiskParameters.class); + + /* + * Specifies the storage account type for the managed disk. NOTE: + * UltraSSD_LRS can only be used with data disks, it cannot be used with OS + * Disk. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the + * managed disk. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /** + * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @return the storageAccountType value. + */ + public StorageAccountTypes storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @param storageAccountType the storageAccountType value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters withDiskEncryptionSet( + DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.java new file mode 100644 index 0000000000000..0ae9338e62128 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's network configurations. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetNetworkConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkConfiguration.class); + + /* + * The network configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Specifies the primary network interface in case the virtual machine has + * more than 1 network interface. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * Specifies whether the network interface is accelerated + * networking-enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "properties.enableFpga") + private Boolean enableFpga; + + /* + * The network security group. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /** + * Get the name property: The network configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The network configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.enableFpga; + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withEnableFpga(Boolean enableFpga) { + this.enableFpga = enableFpga; + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDnsSettings( + VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetNetworkConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetNetworkConfiguration")); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java new file mode 100644 index 0000000000000..e91906183b261 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfigurationDnsSettings { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkConfigurationDnsSettings.class); + + /* + * List of DNS servers IP addresses + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the dnsServers property: List of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationDnsSettings object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java new file mode 100644 index 0000000000000..f2360752545f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile. */ +@Fluent +public final class VirtualMachineScaleSetNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetNetworkProfile.class); + + /* + * A reference to a load balancer probe used to determine the health of an + * instance in the virtual machine scale set. The reference will be in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + */ + @JsonProperty(value = "healthProbe") + private ApiEntityReference healthProbe; + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /* + * specifies the Microsoft.Network API version used when creating + * networking resources in the Network Interface Configurations for Virtual + * Machine Scale Set with orchestration mode 'Flexible' + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /** + * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @return the healthProbe value. + */ + public ApiEntityReference healthProbe() { + return this.healthProbe; + } + + /** + * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param healthProbe the healthProbe value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { + this.healthProbe = healthProbe; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbe() != null) { + healthProbe().validate(); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java new file mode 100644 index 0000000000000..d281dbb462010 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSDisk.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set operating system disk. */ +@Fluent +public final class VirtualMachineScaleSetOSDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetOSDisk.class); + + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the caching requirements.

    Possible values are: + *

    **None**

    **ReadOnly**

    **ReadWrite**

    + * Default: **None for Standard storage. ReadOnly for Premium storage** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This + * value is used when you are using an image to create the virtual machine. + * If you are using a platform image, you also use the imageReference + * element described above. If you are using a marketplace image, you also + * use the plan element previously described. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the ephemeral disk Settings for the operating system disk used + * by the virtual machine scale set. + */ + @JsonProperty(value = "diffDiskSettings") + private DiffDiskSettings diffDiskSettings; + + /* + * Specifies the size of the operating system disk in gigabytes. This + * element can be used to overwrite the size of the disk in a virtual + * machine image.

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * This property allows you to specify the type of the OS that is included + * in the disk if creating a VM from user-image or a specialized VHD. + *

    Possible values are:

    **Windows**

    **Linux** + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * Specifies information about the unmanaged user image to base the scale + * set on. + */ + @JsonProperty(value = "image") + private VirtualHardDisk image; + + /* + * Specifies the container urls that are used to store operating system + * disks for the scale set. + */ + @JsonProperty(value = "vhdContainers") + private List vhdContainers; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private VirtualMachineScaleSetManagedDiskParameters managedDisk; + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. <br><br> Possible values are: + * <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** + * <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. + * + * @param caching the caching value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the createOption property: Specifies how the virtual machines in the scale set should be + * created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform image, you also use the imageReference + * element described above. If you are using a marketplace image, you also use the plan element previously + * described. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machines in the scale set should be + * created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform image, you also use the imageReference + * element described above. If you are using a marketplace image, you also use the plan element previously + * described. + * + * @param createOption the createOption value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by + * the virtual machine scale set. + * + * @return the diffDiskSettings value. + */ + public DiffDiskSettings diffDiskSettings() { + return this.diffDiskSettings; + } + + /** + * Set the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by + * the virtual machine scale set. + * + * @param diffDiskSettings the diffDiskSettings value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings) { + this.diffDiskSettings = diffDiskSettings; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be + * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be + * larger than 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be + * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be + * larger than 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. <br><br> Possible values are: + * <br><br> **Windows** <br><br> **Linux**. + * + * @param osType the osType value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the image property: Specifies information about the unmanaged user image to base the scale set on. + * + * @return the image value. + */ + public VirtualHardDisk image() { + return this.image; + } + + /** + * Set the image property: Specifies information about the unmanaged user image to base the scale set on. + * + * @param image the image value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withImage(VirtualHardDisk image) { + this.image = image; + return this; + } + + /** + * Get the vhdContainers property: Specifies the container urls that are used to store operating system disks for + * the scale set. + * + * @return the vhdContainers value. + */ + public List vhdContainers() { + return this.vhdContainers; + } + + /** + * Set the vhdContainers property: Specifies the container urls that are used to store operating system disks for + * the scale set. + * + * @param vhdContainers the vhdContainers value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withVhdContainers(List vhdContainers) { + this.vhdContainers = vhdContainers; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public VirtualMachineScaleSetManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property createOption in model VirtualMachineScaleSetOSDisk")); + } + if (diffDiskSettings() != null) { + diffDiskSettings().validate(); + } + if (image() != null) { + image().validate(); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java new file mode 100644 index 0000000000000..fcffd4d7546db --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set OS profile. */ +@Fluent +public final class VirtualMachineScaleSetOSProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetOSProfile.class); + + /* + * Specifies the computer name prefix for all of the virtual machines in + * the scale set. Computer name prefixes must be 1 to 15 characters long. + */ + @JsonProperty(value = "computerNamePrefix") + private String computerNamePrefix; + + /* + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + * "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 + * character

    **Max-length (Linux):** 64 characters

    + * **Max-length (Windows):** 20 characters + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 + * characters

    **Max-length (Linux):** 72 characters

    + * **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + *

    For resetting root password, see [Manage users, SSH, and check + * or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the + * Virtual Machine. The maximum length of the binary array is 65535 bytes. + *

    For using cloud-init for your VM, see [Using cloud-init to + * customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** + * Get the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @return the computerNamePrefix value. + */ + public String computerNamePrefix() { + return this.computerNamePrefix; + } + + /** + * Set the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @param computerNamePrefix the computerNamePrefix value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withComputerNamePrefix(String computerNamePrefix) { + this.computerNamePrefix = computerNamePrefix; + return this; + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux + * VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux + * VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @param customData the customData value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the windowsConfiguration value. + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. + * <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the + * scale set. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the + * scale set. + * + * @param secrets the secrets value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java new file mode 100644 index 0000000000000..14bdac758ce07 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetPublicIpAddressConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfiguration.class); + + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes the public IP Sku + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "properties.publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "properties.publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * Specify what happens to the public IP when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /** + * Get the name property: The publicIP address configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The publicIP address configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sku property: Describes the public IP Sku. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the public IP Sku. + * + * @param sku the sku value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withDnsSettings( + VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipTags property: The list of IP tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.publicIpPrefix; + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withPublicIpAddressVersion( + IpVersion publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetPublicIpAddressConfiguration")); + } + if (sku() != null) { + sku().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java new file mode 100644 index 0000000000000..70d601ba04834 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.class); + + /* + * The Domain name label.The concatenation of the domain name label and vm + * index will be the domain name labels of the PublicIPAddress resources + * that will be created + */ + @JsonProperty(value = "domainNameLabel", required = true) + private String domainNameLabel; + + /** + * Get the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index + * will be the domain name labels of the PublicIPAddress resources that will be created. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index + * will be the domain name labels of the PublicIPAddress resources that will be created. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainNameLabel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainNameLabel in model" + + " VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetReimageParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetReimageParameters.java new file mode 100644 index 0000000000000..dd03066cd64ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetReimageParameters.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +@Fluent +public final class VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetReimageParameters.class); + + /* + * The virtual machine scale set instance ids. Omitting the virtual machine + * scale set instance ids will result in the operation being performed on + * all virtual machines in the virtual machine scale set. + */ + @JsonProperty(value = "instanceIds") + private List instanceIds; + + /** + * Get the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set + * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale + * set. + * + * @return the instanceIds value. + */ + public List instanceIds() { + return this.instanceIds; + } + + /** + * Set the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set + * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale + * set. + * + * @param instanceIds the instanceIds value to set. + * @return the VirtualMachineScaleSetReimageParameters object itself. + */ + public VirtualMachineScaleSetReimageParameters withInstanceIds(List instanceIds) { + this.instanceIds = instanceIds; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetReimageParameters withTempDisk(Boolean tempDisk) { + super.withTempDisk(tempDisk); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetRollingUpgrades.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetRollingUpgrades.java new file mode 100644 index 0000000000000..211c42368ecfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetRollingUpgrades.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachineScaleSetRollingUpgrades. */ +public interface VirtualMachineScaleSetRollingUpgrades { + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String vmScaleSetName); + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startOSUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startExtensionUpgrade(String resourceGroupName, String vmScaleSetName); + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + RollingUpgradeStatusInfo getLatest(String resourceGroupName, String vmScaleSetName); + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + Response getLatestWithResponse( + String resourceGroupName, String vmScaleSetName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetScaleInRules.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetScaleInRules.java new file mode 100644 index 0000000000000..444cb5a77291f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetScaleInRules.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualMachineScaleSetScaleInRules. */ +public final class VirtualMachineScaleSetScaleInRules extends ExpandableStringEnum { + /** Static value Default for VirtualMachineScaleSetScaleInRules. */ + public static final VirtualMachineScaleSetScaleInRules DEFAULT = fromString("Default"); + + /** Static value OldestVM for VirtualMachineScaleSetScaleInRules. */ + public static final VirtualMachineScaleSetScaleInRules OLDEST_VM = fromString("OldestVM"); + + /** Static value NewestVM for VirtualMachineScaleSetScaleInRules. */ + public static final VirtualMachineScaleSetScaleInRules NEWEST_VM = fromString("NewestVM"); + + /** + * Creates or finds a VirtualMachineScaleSetScaleInRules from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineScaleSetScaleInRules. + */ + @JsonCreator + public static VirtualMachineScaleSetScaleInRules fromString(String name) { + return fromString(name, VirtualMachineScaleSetScaleInRules.class); + } + + /** @return known VirtualMachineScaleSetScaleInRules values. */ + public static Collection values() { + return values(VirtualMachineScaleSetScaleInRules.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSku.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSku.java new file mode 100644 index 0000000000000..55ac340af5430 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSku.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner; + +/** An immutable client-side representation of VirtualMachineScaleSetSku. */ +public interface VirtualMachineScaleSetSku { + /** + * Gets the resourceType property: The type of resource the sku applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the sku property: The Sku. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + VirtualMachineScaleSetSkuCapacity capacity(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetSkuInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetSkuInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuCapacity.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuCapacity.java new file mode 100644 index 0000000000000..3e89c712e4565 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuCapacity.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes scaling information of a sku. */ +@Immutable +public final class VirtualMachineScaleSetSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetSkuCapacity.class); + + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /* + * The maximum capacity that can be set. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /* + * The default capacity. + */ + @JsonProperty(value = "defaultCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultCapacity; + + /* + * The scale type applicable to the sku. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineScaleSetSkuScaleType scaleType; + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The maximum capacity that can be set. + * + * @return the maximum value. + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the defaultCapacity property: The default capacity. + * + * @return the defaultCapacity value. + */ + public Long defaultCapacity() { + return this.defaultCapacity; + } + + /** + * Get the scaleType property: The scale type applicable to the sku. + * + * @return the scaleType value. + */ + public VirtualMachineScaleSetSkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuScaleType.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuScaleType.java new file mode 100644 index 0000000000000..a52c420771749 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetSkuScaleType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VirtualMachineScaleSetSkuScaleType. */ +public enum VirtualMachineScaleSetSkuScaleType { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a VirtualMachineScaleSetSkuScaleType instance. */ + private final String value; + + VirtualMachineScaleSetSkuScaleType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VirtualMachineScaleSetSkuScaleType instance. + * + * @param value the serialized value to parse. + * @return the parsed VirtualMachineScaleSetSkuScaleType object, or null if unable to parse. + */ + @JsonCreator + public static VirtualMachineScaleSetSkuScaleType fromString(String value) { + VirtualMachineScaleSetSkuScaleType[] items = VirtualMachineScaleSetSkuScaleType.values(); + for (VirtualMachineScaleSetSkuScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetStorageProfile.java new file mode 100644 index 0000000000000..69b6b027ffd60 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetStorageProfile.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set storage profile. */ +@Fluent +public final class VirtualMachineScaleSetStorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetStorageProfile.class); + + /* + * Specifies information about the image to use. You can specify + * information about platform images, marketplace images, or virtual + * machine images. This element is required when you want to use a platform + * image, marketplace image, or virtual machine image, but is not used in + * other creation operations. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the + * virtual machines in the scale set.

    For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private VirtualMachineScaleSetOSDisk osDisk; + + /* + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machines in + * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public VirtualMachineScaleSetOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machines in + * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withOsDisk(VirtualMachineScaleSetOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdate.java new file mode 100644 index 0000000000000..9b08dd8f1f976 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdate.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine Scale Set. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetUpdate extends UpdateResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdate.class); + + /* + * The virtual machine scale set sku. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The purchase plan when deploying a virtual machine scale set from VM + * Marketplace images. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The identity of the virtual machine scale set, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineScaleSetIdentity identity; + + /* + * The upgrade policy. + */ + @JsonProperty(value = "properties.upgradePolicy") + private UpgradePolicy upgradePolicy; + + /* + * Policy for automatic repairs. + */ + @JsonProperty(value = "properties.automaticRepairsPolicy") + private AutomaticRepairsPolicy automaticRepairsPolicy; + + /* + * The virtual machine profile. + */ + @JsonProperty(value = "properties.virtualMachineProfile") + private VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile; + + /* + * Specifies whether the Virtual Machine Scale Set should be + * overprovisioned. + */ + @JsonProperty(value = "properties.overprovision") + private Boolean overprovision; + + /* + * When Overprovision is enabled, extensions are launched only on the + * requested number of VMs which are finally kept. This property will hence + * ensure that the extensions do not run on the extra overprovisioned VMs. + */ + @JsonProperty(value = "properties.doNotRunExtensionsOnOverprovisionedVMs") + private Boolean doNotRunExtensionsOnOverprovisionedVMs; + + /* + * When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may + * be modified to false. However, if singlePlacementGroup is false, it may + * not be modified to true. + */ + @JsonProperty(value = "properties.singlePlacementGroup") + private Boolean singlePlacementGroup; + + /* + * Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the + * Virtual Machines have the capability to support attaching managed data + * disks with UltraSSD_LRS storage account type. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private AdditionalCapabilities additionalCapabilities; + + /* + * Specifies the scale-in policy that decides which virtual machines are + * chosen for removal when a Virtual Machine Scale Set is scaled-in. + */ + @JsonProperty(value = "properties.scaleInPolicy") + private ScaleInPolicy scaleInPolicy; + + /* + * Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to.

    Minimum + * api-version: 2018-04-01. + */ + @JsonProperty(value = "properties.proximityPlacementGroup") + private SubResource proximityPlacementGroup; + + /** + * Get the sku property: The virtual machine scale set sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The virtual machine scale set sku. + * + * @param sku the sku value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the plan property: The purchase plan when deploying a virtual machine scale set from VM Marketplace images. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: The purchase plan when deploying a virtual machine scale set from VM Marketplace images. + * + * @param plan the plan value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the identity property: The identity of the virtual machine scale set, if configured. + * + * @return the identity value. + */ + public VirtualMachineScaleSetIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the virtual machine scale set, if configured. + * + * @param identity the identity value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withIdentity(VirtualMachineScaleSetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: The upgrade policy. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withUpgradePolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @return the automaticRepairsPolicy value. + */ + public AutomaticRepairsPolicy automaticRepairsPolicy() { + return this.automaticRepairsPolicy; + } + + /** + * Set the automaticRepairsPolicy property: Policy for automatic repairs. + * + * @param automaticRepairsPolicy the automaticRepairsPolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withAutomaticRepairsPolicy(AutomaticRepairsPolicy automaticRepairsPolicy) { + this.automaticRepairsPolicy = automaticRepairsPolicy; + return this; + } + + /** + * Get the virtualMachineProfile property: The virtual machine profile. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile() { + return this.virtualMachineProfile; + } + + /** + * Set the virtualMachineProfile property: The virtual machine profile. + * + * @param virtualMachineProfile the virtualMachineProfile value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withVirtualMachineProfile( + VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { + this.virtualMachineProfile = virtualMachineProfile; + return this; + } + + /** + * Get the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @return the overprovision value. + */ + public Boolean overprovision() { + return this.overprovision; + } + + /** + * Set the overprovision property: Specifies whether the Virtual Machine Scale Set should be overprovisioned. + * + * @param overprovision the overprovision value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withOverprovision(Boolean overprovision) { + this.overprovision = overprovision; + return this; + } + + /** + * Get the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched + * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions + * do not run on the extra overprovisioned VMs. + * + * @return the doNotRunExtensionsOnOverprovisionedVMs value. + */ + public Boolean doNotRunExtensionsOnOverprovisionedVMs() { + return this.doNotRunExtensionsOnOverprovisionedVMs; + } + + /** + * Set the doNotRunExtensionsOnOverprovisionedVMs property: When Overprovision is enabled, extensions are launched + * only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions + * do not run on the extra overprovisioned VMs. + * + * @param doNotRunExtensionsOnOverprovisionedVMs the doNotRunExtensionsOnOverprovisionedVMs value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withDoNotRunExtensionsOnOverprovisionedVMs( + Boolean doNotRunExtensionsOnOverprovisionedVMs) { + this.doNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs; + return this; + } + + /** + * Get the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * + * @return the singlePlacementGroup value. + */ + public Boolean singlePlacementGroup() { + return this.singlePlacementGroup; + } + + /** + * Set the singlePlacementGroup property: When true this limits the scale set to a single placement group, of max + * size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if + * singlePlacementGroup is false, it may not be modified to true. + * + * @param singlePlacementGroup the singlePlacementGroup value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withSinglePlacementGroup(Boolean singlePlacementGroup) { + this.singlePlacementGroup = singlePlacementGroup; + return this; + } + + /** + * Get the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * + * @return the additionalCapabilities value. + */ + public AdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the Virtual + * Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to + * support attaching managed data disks with UltraSSD_LRS storage account type. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withAdditionalCapabilities(AdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * + * @return the scaleInPolicy value. + */ + public ScaleInPolicy scaleInPolicy() { + return this.scaleInPolicy; + } + + /** + * Set the scaleInPolicy property: Specifies the scale-in policy that decides which virtual machines are chosen for + * removal when a Virtual Machine Scale Set is scaled-in. + * + * @param scaleInPolicy the scaleInPolicy value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withScaleInPolicy(ScaleInPolicy scaleInPolicy) { + this.scaleInPolicy = scaleInPolicy; + return this; + } + + /** + * Get the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + public SubResource proximityPlacementGroup() { + return this.proximityPlacementGroup; + } + + /** + * Set the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @param proximityPlacementGroup the proximityPlacementGroup value to set. + * @return the VirtualMachineScaleSetUpdate object itself. + */ + public VirtualMachineScaleSetUpdate withProximityPlacementGroup(SubResource proximityPlacementGroup) { + this.proximityPlacementGroup = proximityPlacementGroup; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } + if (automaticRepairsPolicy() != null) { + automaticRepairsPolicy().validate(); + } + if (virtualMachineProfile() != null) { + virtualMachineProfile().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (scaleInPolicy() != null) { + scaleInPolicy().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateIpConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateIpConfiguration.java new file mode 100644 index 0000000000000..971c1dcb5efe2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateIpConfiguration.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be + * modified as long as the original subnet and the new subnet are in the same virtual network. + */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetUpdateIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateIpConfiguration.class); + + /* + * The IP configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The subnet. + */ + @JsonProperty(value = "properties.subnet") + private ApiEntityReference subnet; + + /* + * Specifies the primary IP Configuration in case the network interface has + * more than one IP Configuration. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "properties.publicIPAddressConfiguration") + private VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration; + + /* + * Available from Api-Version 2017-03-30 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + * Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "properties.privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * The application gateway backend address pools. + */ + @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * The load balancer backend address pools. + */ + @JsonProperty(value = "properties.loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * The load balancer inbound nat pools. + */ + @JsonProperty(value = "properties.loadBalancerInboundNatPools") + private List loadBalancerInboundNatPools; + + /** + * Get the name property: The IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The IP configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the subnet property: The subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withSubnet(ApiEntityReference subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Specifies the primary IP Configuration in case the network interface has more than one + * IP Configuration. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary IP Configuration in case the network interface has more than one + * IP Configuration. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.publicIpAddressConfiguration; + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withPublicIpAddressConfiguration( + VirtualMachineScaleSetUpdatePublicIpAddressConfiguration publicIpAddressConfiguration) { + this.publicIpAddressConfiguration = publicIpAddressConfiguration; + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: The application gateway backend address pools. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: The application gateway backend address pools. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withApplicationGatewayBackendAddressPools( + List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withApplicationSecurityGroups( + List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: The load balancer backend address pools. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: The load balancer backend address pools. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools. + * + * @return the loadBalancerInboundNatPools value. + */ + public List loadBalancerInboundNatPools() { + return this.loadBalancerInboundNatPools; + } + + /** + * Set the loadBalancerInboundNatPools property: The load balancer inbound nat pools. + * + * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. + * @return the VirtualMachineScaleSetUpdateIpConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIpConfiguration withLoadBalancerInboundNatPools( + List loadBalancerInboundNatPools) { + this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetUpdateIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddressConfiguration() != null) { + publicIpAddressConfiguration().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java new file mode 100644 index 0000000000000..d63efd06fa02e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile's network configurations. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetUpdateNetworkConfiguration extends SubResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateNetworkConfiguration.class); + + /* + * The network configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Whether this is a primary NIC on a virtual machine. + */ + @JsonProperty(value = "properties.primary") + private Boolean primary; + + /* + * Specifies whether the network interface is accelerated + * networking-enabled. + */ + @JsonProperty(value = "properties.enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "properties.enableFpga") + private Boolean enableFpga; + + /* + * The network security group. + */ + @JsonProperty(value = "properties.networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; + + /* + * The virtual machine scale set IP Configuration. + */ + @JsonProperty(value = "properties.ipConfigurations") + private List ipConfigurations; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /** + * Get the name property: The network configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The network configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the primary property: Whether this is a primary NIC on a virtual machine. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Whether this is a primary NIC on a virtual machine. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableAcceleratedNetworking( + Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.enableFpga; + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableFpga(Boolean enableFpga) { + this.enableFpga = enableFpga; + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withDnsSettings( + VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipConfigurations property: The virtual machine scale set IP Configuration. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: The virtual machine scale set IP Configuration. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetUpdateNetworkConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java new file mode 100644 index 0000000000000..83067e4471041 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set network profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateNetworkProfile.class); + + /* + * A reference to a load balancer probe used to determine the health of an + * instance in the virtual machine scale set. The reference will be in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + */ + @JsonProperty(value = "healthProbe") + private ApiEntityReference healthProbe; + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /* + * specifies the Microsoft.Network API version used when creating + * networking resources in the Network Interface Configurations for Virtual + * Machine Scale Set with orchestration mode 'Flexible' + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /** + * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @return the healthProbe value. + */ + public ApiEntityReference healthProbe() { + return this.healthProbe; + } + + /** + * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param healthProbe the healthProbe value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { + this.healthProbe = healthProbe; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. + */ + public VirtualMachineScaleSetUpdateNetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbe() != null) { + healthProbe().validate(); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java new file mode 100644 index 0000000000000..a34e56c26f841 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSDisk.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS + * Disk. + */ +@Fluent +public final class VirtualMachineScaleSetUpdateOSDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateOSDisk.class); + + /* + * The caching type. + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * Specifies the size of the operating system disk in gigabytes. This + * element can be used to overwrite the size of the disk in a virtual + * machine image.

    This value cannot be larger than 1023 GB + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The Source User Image VirtualHardDisk. This VirtualHardDisk will be + * copied before using it to attach to the Virtual Machine. If SourceImage + * is provided, the destination VirtualHardDisk should not exist. + */ + @JsonProperty(value = "image") + private VirtualHardDisk image; + + /* + * The list of virtual hard disk container uris. + */ + @JsonProperty(value = "vhdContainers") + private List vhdContainers; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private VirtualMachineScaleSetManagedDiskParameters managedDisk; + + /** + * Get the caching property: The caching type. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: The caching type. + * + * @param caching the caching value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be + * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be + * larger than 1023 GB. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of the operating system disk in gigabytes. This element can be + * used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be + * larger than 1023 GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the image property: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not + * exist. + * + * @return the image value. + */ + public VirtualHardDisk image() { + return this.image; + } + + /** + * Set the image property: The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not + * exist. + * + * @param image the image value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withImage(VirtualHardDisk image) { + this.image = image; + return this; + } + + /** + * Get the vhdContainers property: The list of virtual hard disk container uris. + * + * @return the vhdContainers value. + */ + public List vhdContainers() { + return this.vhdContainers; + } + + /** + * Set the vhdContainers property: The list of virtual hard disk container uris. + * + * @param vhdContainers the vhdContainers value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withVhdContainers(List vhdContainers) { + this.vhdContainers = vhdContainers; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public VirtualMachineScaleSetManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() != null) { + image().validate(); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSProfile.java new file mode 100644 index 0000000000000..5fdc8351e7d14 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateOSProfile.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set OS profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateOSProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateOSProfile.class); + + /* + * A base-64 encoded string of custom data. + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * The Windows Configuration of the OS profile. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * The Linux Configuration of the OS profile. + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * The List of certificates for addition to the VM. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** + * Get the customData property: A base-64 encoded string of custom data. + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: A base-64 encoded string of custom data. + * + * @param customData the customData value to set. + * @return the VirtualMachineScaleSetUpdateOSProfile object itself. + */ + public VirtualMachineScaleSetUpdateOSProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the windowsConfiguration property: The Windows Configuration of the OS profile. + * + * @return the windowsConfiguration value. + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: The Windows Configuration of the OS profile. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualMachineScaleSetUpdateOSProfile object itself. + */ + public VirtualMachineScaleSetUpdateOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: The Linux Configuration of the OS profile. + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: The Linux Configuration of the OS profile. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualMachineScaleSetUpdateOSProfile object itself. + */ + public VirtualMachineScaleSetUpdateOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: The List of certificates for addition to the VM. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The List of certificates for addition to the VM. + * + * @param secrets the secrets value to set. + * @return the VirtualMachineScaleSetUpdateOSProfile object itself. + */ + public VirtualMachineScaleSetUpdateOSProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java new file mode 100644 index 0000000000000..11cbb5eabc413 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetUpdatePublicIpAddressConfiguration { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.class); + + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "properties.idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "properties.dnsSettings") + private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; + + /* + * Specify what happens to the public IP when the VM is deleted + */ + @JsonProperty(value = "properties.deleteOption") + private DeleteOptions deleteOption; + + /** + * Get the name property: The publicIP address configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The publicIP address configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withIdleTimeoutInMinutes( + Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withDnsSettings( + VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetUpdatePublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetUpdatePublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateStorageProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateStorageProfile.java new file mode 100644 index 0000000000000..43573f1361d3f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateStorageProfile.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set storage profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateStorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateStorageProfile.class); + + /* + * The image reference. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * The OS disk. + */ + @JsonProperty(value = "osDisk") + private VirtualMachineScaleSetUpdateOSDisk osDisk; + + /* + * The data disks. + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * Get the imageReference property: The image reference. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image reference. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. + */ + public VirtualMachineScaleSetUpdateStorageProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: The OS disk. + * + * @return the osDisk value. + */ + public VirtualMachineScaleSetUpdateOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: The OS disk. + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. + */ + public VirtualMachineScaleSetUpdateStorageProfile withOsDisk(VirtualMachineScaleSetUpdateOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: The data disks. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: The data disks. + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. + */ + public VirtualMachineScaleSetUpdateStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java new file mode 100644 index 0000000000000..9788d7e1bcf21 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set virtual machine profile. */ +@Fluent +public final class VirtualMachineScaleSetUpdateVMProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetUpdateVMProfile.class); + + /* + * The virtual machine scale set OS profile. + */ + @JsonProperty(value = "osProfile") + private VirtualMachineScaleSetUpdateOSProfile osProfile; + + /* + * The virtual machine scale set storage profile. + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineScaleSetUpdateStorageProfile storageProfile; + + /* + * The virtual machine scale set network profile. + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineScaleSetUpdateNetworkProfile networkProfile; + + /* + * The virtual machine scale set Security profile + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * The virtual machine scale set diagnostics profile. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * The virtual machine scale set extension profile. + */ + @JsonProperty(value = "extensionProfile") + private VirtualMachineScaleSetExtensionProfile extensionProfile; + + /* + * The license type, which is for bring your own license scenario. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Specifies the billing related details of a Azure Spot VMSS. + *

    Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the VM, which must be base-64 encoded. Customer should not + * pass any secrets in here.

    Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "userData") + private String userData; + + /** + * Get the osProfile property: The virtual machine scale set OS profile. + * + * @return the osProfile value. + */ + public VirtualMachineScaleSetUpdateOSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: The virtual machine scale set OS profile. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withOsProfile(VirtualMachineScaleSetUpdateOSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the storageProfile property: The virtual machine scale set storage profile. + * + * @return the storageProfile value. + */ + public VirtualMachineScaleSetUpdateStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: The virtual machine scale set storage profile. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withStorageProfile( + VirtualMachineScaleSetUpdateStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the networkProfile property: The virtual machine scale set network profile. + * + * @return the networkProfile value. + */ + public VirtualMachineScaleSetUpdateNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: The virtual machine scale set network profile. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withNetworkProfile( + VirtualMachineScaleSetUpdateNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the securityProfile property: The virtual machine scale set Security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: The virtual machine scale set Security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: The virtual machine scale set diagnostics profile. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: The virtual machine scale set diagnostics profile. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the extensionProfile property: The virtual machine scale set extension profile. + * + * @return the extensionProfile value. + */ + public VirtualMachineScaleSetExtensionProfile extensionProfile() { + return this.extensionProfile; + } + + /** + * Set the extensionProfile property: The virtual machine scale set extension profile. + * + * @param extensionProfile the extensionProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withExtensionProfile( + VirtualMachineScaleSetExtensionProfile extensionProfile) { + this.extensionProfile = extensionProfile; + return this; + } + + /** + * Get the licenseType property: The license type, which is for bring your own license scenario. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type, which is for bring your own license scenario. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.billingProfile; + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withScheduledEventsProfile( + ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetUpdateVMProfile object itself. + */ + public VirtualMachineScaleSetUpdateVMProfile withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.java new file mode 100644 index 0000000000000..278f06de5a3aa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineScaleSetVM. */ +public interface VirtualMachineScaleSetVM { + /** + * 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 instanceId property: The virtual machine instance ID. + * + * @return the instanceId value. + */ + String instanceId(); + + /** + * Gets the sku property: The virtual machine SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the plan property: Specifies information about the marketplace image used to create the virtual machine. + * This element is only used for marketplace images. Before you can use a marketplace image from an API, you must + * enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and + * then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the resources property: The virtual machine child extension resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the zones property: The virtual machine zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the latestModelApplied property: Specifies whether the latest model has been applied to the virtual machine. + * + * @return the latestModelApplied value. + */ + Boolean latestModelApplied(); + + /** + * Gets the vmId property: Azure VM unique ID. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + VirtualMachineScaleSetVMInstanceView instanceView(); + + /** + * Gets the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + HardwareProfile hardwareProfile(); + + /** + * Gets the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * Gets the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine in the scale set. For instance: whether the virtual machine has the capability to support attaching + * managed data disks with UltraSSD_LRS storage account type. + * + * @return the additionalCapabilities value. + */ + AdditionalCapabilities additionalCapabilities(); + + /** + * Gets the osProfile property: Specifies the operating system settings for the virtual machine. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + SecurityProfile securityProfile(); + + /** + * Gets the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the networkProfileConfiguration property: Specifies the network profile configuration of the virtual + * machine. + * + * @return the networkProfileConfiguration value. + */ + VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration(); + + /** + * Gets the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability + * set. + * + * @return the availabilitySet value. + */ + SubResource availabilitySet(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + String licenseType(); + + /** + * Gets the modelDefinitionApplied property: Specifies whether the model applied to the virtual machine is the model + * of the virtual machine scale set or the customized model for the virtual machine. + * + * @return the modelDefinitionApplied value. + */ + String modelDefinitionApplied(); + + /** + * Gets the protectionPolicy property: Specifies the protection policy of the virtual machine. + * + * @return the protectionPolicy value. + */ + VirtualMachineScaleSetVMProtectionPolicy protectionPolicy(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetVMInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtension.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtension.java new file mode 100644 index 0000000000000..2c93e69226d5d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtension.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner; + +/** An immutable client-side representation of VirtualMachineScaleSetVMExtension. */ +public interface VirtualMachineScaleSetVMExtension { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the extension. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Object settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + VirtualMachineExtensionInstanceView instanceView(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionInner + * object. + * + * @return the inner object. + */ + VirtualMachineScaleSetVMExtensionInner innerModel(); + + /** The entirety of the VirtualMachineScaleSetVMExtension definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualMachineScaleSetVMExtension definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachineScaleSetVMExtension definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vmScaleSetName, instanceId. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @return the next definition stage. + */ + WithCreate withExistingVirtualMachine(String resourceGroupName, String vmScaleSetName, String instanceId); + } + /** + * The stage of the VirtualMachineScaleSetVMExtension 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.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachineScaleSetVMExtension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachineScaleSetVMExtension create(Context context); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** + * The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify autoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Object settings); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + /** The stage of the VirtualMachineScaleSetVMExtension definition allowing to specify instanceView. */ + interface WithInstanceView { + /** + * Specifies the instanceView property: The virtual machine extension instance view.. + * + * @param instanceView The virtual machine extension instance view. + * @return the next definition stage. + */ + WithCreate withInstanceView(VirtualMachineExtensionInstanceView instanceView); + } + } + /** + * Begins update for the VirtualMachineScaleSetVMExtension resource. + * + * @return the stage of resource update. + */ + VirtualMachineScaleSetVMExtension.Update update(); + + /** The template for VirtualMachineScaleSetVMExtension update. */ + interface Update + extends UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachineScaleSetVMExtension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachineScaleSetVMExtension apply(Context context); + } + /** The VirtualMachineScaleSetVMExtension update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withTypePropertiesType(String typePropertiesType); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version of the extension available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Object settings); + } + /** The stage of the VirtualMachineScaleSetVMExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + Update withProtectedSettings(Object protectedSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachineScaleSetVMExtension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachineScaleSetVMExtension refresh(Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionUpdate.java new file mode 100644 index 0000000000000..f2e92804a2116 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionUpdate.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a VMSS VM Extension. */ +@JsonFlatten +@Fluent +public class VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionUpdate.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensions.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensions.java new file mode 100644 index 0000000000000..834adf7067af7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensions.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachineScaleSetVMExtensions. */ +public interface VirtualMachineScaleSetVMExtensions { + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName); + + /** + * The operation to delete the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String vmExtensionName, Context context); + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + VirtualMachineScaleSetVMExtension get( + String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); + + /** + * The operation to get the VMSS VM extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String vmExtensionName, + String expand, + Context context); + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + VirtualMachineScaleSetVMExtensionsListResult list( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to get all extensions of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List VMSS VM Extension operation response. + */ + Response listWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); + + /** + * The operation to get the VMSS VM extension. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + VirtualMachineScaleSetVMExtension getById(String id); + + /** + * The operation to get the VMSS VM extension. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a VMSS VM Extension. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * The operation to delete the VMSS VM extension. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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); + + /** + * The operation to delete the VMSS VM extension. + * + * @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.resourcemanager.compute.generated.models.ApiErrorException 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, Context context); + + /** + * Begins definition for a new VirtualMachineScaleSetVMExtension resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineScaleSetVMExtension definition. + */ + VirtualMachineScaleSetVMExtension.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsListResult.java new file mode 100644 index 0000000000000..19413e89f7abc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsListResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineScaleSetVMExtensionsListResult. */ +public interface VirtualMachineScaleSetVMExtensionsListResult { + /** + * Gets the value property: The list of VMSS VM extensions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMExtensionsListResultInner + * object. + * + * @return the inner object. + */ + VirtualMachineScaleSetVMExtensionsListResultInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsSummary.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsSummary.java new file mode 100644 index 0000000000000..0259208782e94 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMExtensionsSummary.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Extensions summary for virtual machines of a virtual machine scale set. */ +@Immutable +public final class VirtualMachineScaleSetVMExtensionsSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMExtensionsSummary.class); + + /* + * The extension name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The extensions information. + */ + @JsonProperty(value = "statusesSummary", access = JsonProperty.Access.WRITE_ONLY) + private List statusesSummary; + + /** + * Get the name property: The extension name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the statusesSummary property: The extensions information. + * + * @return the statusesSummary value. + */ + public List statusesSummary() { + return this.statusesSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusesSummary() != null) { + statusesSummary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceIDs.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceIDs.java new file mode 100644 index 0000000000000..d6057c562c172 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceIDs.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a list of virtual machine instance IDs from the VM scale set. */ +@Fluent +public final class VirtualMachineScaleSetVMInstanceIDs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceIDs.class); + + /* + * The virtual machine scale set instance ids. Omitting the virtual machine + * scale set instance ids will result in the operation being performed on + * all virtual machines in the virtual machine scale set. + */ + @JsonProperty(value = "instanceIds") + private List instanceIds; + + /** + * Get the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set + * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale + * set. + * + * @return the instanceIds value. + */ + public List instanceIds() { + return this.instanceIds; + } + + /** + * Set the instanceIds property: The virtual machine scale set instance ids. Omitting the virtual machine scale set + * instance ids will result in the operation being performed on all virtual machines in the virtual machine scale + * set. + * + * @param instanceIds the instanceIds value to set. + * @return the VirtualMachineScaleSetVMInstanceIDs object itself. + */ + public VirtualMachineScaleSetVMInstanceIDs withInstanceIds(List instanceIds) { + this.instanceIds = instanceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java new file mode 100644 index 0000000000000..aed22dee765ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceRequiredIDs.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a list of virtual machine instance IDs from the VM scale set. */ +@Fluent +public final class VirtualMachineScaleSetVMInstanceRequiredIDs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMInstanceRequiredIDs.class); + + /* + * The virtual machine scale set instance ids. + */ + @JsonProperty(value = "instanceIds", required = true) + private List instanceIds; + + /** + * Get the instanceIds property: The virtual machine scale set instance ids. + * + * @return the instanceIds value. + */ + public List instanceIds() { + return this.instanceIds; + } + + /** + * Set the instanceIds property: The virtual machine scale set instance ids. + * + * @param instanceIds the instanceIds value to set. + * @return the VirtualMachineScaleSetVMInstanceRequiredIDs object itself. + */ + public VirtualMachineScaleSetVMInstanceRequiredIDs withInstanceIds(List instanceIds) { + this.instanceIds = instanceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceIds() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property instanceIds in model VirtualMachineScaleSetVMInstanceRequiredIDs")); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceView.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceView.java new file mode 100644 index 0000000000000..44f4123fb36e3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMInstanceView.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.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner; +import java.util.List; + +/** An immutable client-side representation of VirtualMachineScaleSetVMInstanceView. */ +public interface VirtualMachineScaleSetVMInstanceView { + /** + * Gets the platformUpdateDomain property: The Update Domain count. + * + * @return the platformUpdateDomain value. + */ + Integer platformUpdateDomain(); + + /** + * Gets the platformFaultDomain property: The Fault Domain count. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the rdpThumbPrint property: The Remote desktop certificate thumbprint. + * + * @return the rdpThumbPrint value. + */ + String rdpThumbPrint(); + + /** + * Gets the vmAgent property: The VM Agent running on the virtual machine. + * + * @return the vmAgent value. + */ + VirtualMachineAgentInstanceView vmAgent(); + + /** + * Gets the maintenanceRedeployStatus property: The Maintenance Operation status on the virtual machine. + * + * @return the maintenanceRedeployStatus value. + */ + MaintenanceRedeployStatus maintenanceRedeployStatus(); + + /** + * Gets the disks property: The disks information. + * + * @return the disks value. + */ + List disks(); + + /** + * Gets the extensions property: The extensions information. + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the vmHealth property: The health status for the VM. + * + * @return the vmHealth value. + */ + VirtualMachineHealthStatus vmHealth(); + + /** + * Gets the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console + * log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + BootDiagnosticsInstanceView bootDiagnostics(); + + /** + * Gets the statuses property: The resource status information. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the assignedHost property: Resource id of the dedicated host, on which the virtual machine is allocated + * through automatic placement, when the virtual machine is associated with a dedicated host group that has + * automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. + * + * @return the assignedHost value. + */ + String assignedHost(); + + /** + * Gets the placementGroupId property: The placement group in which the VM is running. If the VM is deallocated it + * will not have a placementGroupId. + * + * @return the placementGroupId value. + */ + String placementGroupId(); + + /** + * Gets the inner + * com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInstanceViewInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetVMInstanceViewInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMListResult.java new file mode 100644 index 0000000000000..fdcc58311dd37 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine Scale Set VMs operation response. */ +@Fluent +public final class VirtualMachineScaleSetVMListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMListResult.class); + + /* + * The list of virtual machine scale sets VMs. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of Virtual Machine Scale Set VMs. Call + * ListNext() with this to fetch the next page of VMSS VMs + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of virtual machine scale sets VMs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine scale sets VMs. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetVMListResult object itself. + */ + public VirtualMachineScaleSetVMListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with + * this to fetch the next page of VMSS VMs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with + * this to fetch the next page of VMSS VMs. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetVMListResult object itself. + */ + public VirtualMachineScaleSetVMListResult 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 VirtualMachineScaleSetVMListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java new file mode 100644 index 0000000000000..6da8dd9f9f8fe --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a virtual machine scale set VM network profile. */ +@Fluent +public final class VirtualMachineScaleSetVMNetworkProfileConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMNetworkProfileConfiguration.class); + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetVMNetworkProfileConfiguration object itself. + */ + public VirtualMachineScaleSetVMNetworkProfileConfiguration withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java new file mode 100644 index 0000000000000..6effc8ed0e9fb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a virtual machine scale set virtual machine profile. */ +@Fluent +public final class VirtualMachineScaleSetVMProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMProfile.class); + + /* + * Specifies the operating system settings for the virtual machines in the + * scale set. + */ + @JsonProperty(value = "osProfile") + private VirtualMachineScaleSetOSProfile osProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineScaleSetStorageProfile storageProfile; + + /* + * Specifies properties of the network interfaces of the virtual machines + * in the scale set. + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineScaleSetNetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machines + * in the scale set. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state.

    Minimum + * api-version: 2015-06-15. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + */ + @JsonProperty(value = "extensionProfile") + private VirtualMachineScaleSetExtensionProfile extensionProfile; + + /* + * Specifies that the image or disk that is being used was licensed + * on-premises.

    Possible values for Windows Server operating + * system are:

    Windows_Client

    Windows_Server

    + * Possible values for Linux Server operating system are:

    + * RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + *

    [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + *

    Minimum api-version: 2015-06-15 + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Specifies the priority for the virtual machines in the scale set. + *

    Minimum api-version: 2017-10-30-preview + */ + @JsonProperty(value = "priority") + private VirtualMachinePriorityTypes priority; + + /* + * Specifies the eviction policy for the Azure Spot virtual machine and + * Azure Spot scale set.

    For Azure Spot virtual machines, both + * 'Deallocate' and 'Delete' are supported and the minimum api-version is + * 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is + * 2017-10-30-preview. + */ + @JsonProperty(value = "evictionPolicy") + private VirtualMachineEvictionPolicyTypes evictionPolicy; + + /* + * Specifies the billing related details of a Azure Spot VMSS. + *

    Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the virtual machines in the scale set, which must be + * base-64 encoded. Customer should not pass any secrets in here. + *

    Minimum api-version: 2021-03-01 + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies the capacity reservation related details of a scale set. + *

    Minimum api-version: 2021-04-01. + */ + @JsonProperty(value = "capacityReservation") + private CapacityReservationProfile capacityReservation; + + /** + * Get the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. + * + * @return the osProfile value. + */ + public VirtualMachineScaleSetOSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withOsProfile(VirtualMachineScaleSetOSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public VirtualMachineScaleSetStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withStorageProfile(VirtualMachineScaleSetStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the + * scale set. + * + * @return the networkProfile value. + */ + public VirtualMachineScaleSetNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the + * scale set. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withNetworkProfile(VirtualMachineScaleSetNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the securityProfile property: Specifies the Security related profile settings for the virtual machines in the + * scale set. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the Security related profile settings for the virtual machines in the + * scale set. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the extensionProfile property: Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @return the extensionProfile value. + */ + public VirtualMachineScaleSetExtensionProfile extensionProfile() { + return this.extensionProfile; + } + + /** + * Set the extensionProfile property: Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param extensionProfile the extensionProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withExtensionProfile( + VirtualMachineScaleSetExtensionProfile extensionProfile) { + this.extensionProfile = extensionProfile; + return this; + } + + /** + * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machines in the scale set. + * <br><br>Minimum api-version: 2017-10-30-preview. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.priority; + } + + /** + * Set the priority property: Specifies the priority for the virtual machines in the scale set. + * <br><br>Minimum api-version: 2017-10-30-preview. + * + * @param priority the priority value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withPriority(VirtualMachinePriorityTypes priority) { + this.priority = priority; + return this; + } + + /** + * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.billingProfile; + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. + * <br><br>Minimum api-version: 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies the capacity reservation related details of a scale set. + * <br><br>Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies the capacity reservation related details of a scale set. + * <br><br>Minimum api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProtectionPolicy.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProtectionPolicy.java new file mode 100644 index 0000000000000..e1cbbed82e178 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProtectionPolicy.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The protection policy of a virtual machine scale set VM. */ +@Fluent +public final class VirtualMachineScaleSetVMProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMProtectionPolicy.class); + + /* + * Indicates that the virtual machine scale set VM shouldn't be considered + * for deletion during a scale-in operation. + */ + @JsonProperty(value = "protectFromScaleIn") + private Boolean protectFromScaleIn; + + /* + * Indicates that model updates or actions (including scale-in) initiated + * on the virtual machine scale set should not be applied to the virtual + * machine scale set VM. + */ + @JsonProperty(value = "protectFromScaleSetActions") + private Boolean protectFromScaleSetActions; + + /** + * Get the protectFromScaleIn property: Indicates that the virtual machine scale set VM shouldn't be considered for + * deletion during a scale-in operation. + * + * @return the protectFromScaleIn value. + */ + public Boolean protectFromScaleIn() { + return this.protectFromScaleIn; + } + + /** + * Set the protectFromScaleIn property: Indicates that the virtual machine scale set VM shouldn't be considered for + * deletion during a scale-in operation. + * + * @param protectFromScaleIn the protectFromScaleIn value to set. + * @return the VirtualMachineScaleSetVMProtectionPolicy object itself. + */ + public VirtualMachineScaleSetVMProtectionPolicy withProtectFromScaleIn(Boolean protectFromScaleIn) { + this.protectFromScaleIn = protectFromScaleIn; + return this; + } + + /** + * Get the protectFromScaleSetActions property: Indicates that model updates or actions (including scale-in) + * initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. + * + * @return the protectFromScaleSetActions value. + */ + public Boolean protectFromScaleSetActions() { + return this.protectFromScaleSetActions; + } + + /** + * Set the protectFromScaleSetActions property: Indicates that model updates or actions (including scale-in) + * initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. + * + * @param protectFromScaleSetActions the protectFromScaleSetActions value to set. + * @return the VirtualMachineScaleSetVMProtectionPolicy object itself. + */ + public VirtualMachineScaleSetVMProtectionPolicy withProtectFromScaleSetActions(Boolean protectFromScaleSetActions) { + this.protectFromScaleSetActions = protectFromScaleSetActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMReimageParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMReimageParameters.java new file mode 100644 index 0000000000000..8cff9b83095cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMReimageParameters.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +@Fluent +public class VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMReimageParameters.class); + + /** {@inheritDoc} */ + @Override + public VirtualMachineScaleSetVMReimageParameters withTempDisk(Boolean tempDisk) { + super.withTempDisk(tempDisk); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMRunCommands.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMRunCommands.java new file mode 100644 index 0000000000000..66cafd1d1f784 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMRunCommands.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.VirtualMachineRunCommandInner; + +/** Resource collection API of VirtualMachineScaleSetVMRunCommands. */ +public interface VirtualMachineScaleSetVMRunCommands { + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand); + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandInner runCommand, + Context context); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand); + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + VirtualMachineRunCommandUpdate runCommand, + Context context); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException 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 vmScaleSetName, String instanceId, String runCommandName, Context context); + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + VirtualMachineRunCommand get( + String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine run command. + */ + Response getWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + String runCommandName, + String expand, + Context context); + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + PagedIterable list(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List run command operation response. + */ + PagedIterable list( + String resourceGroupName, String vmScaleSetName, String instanceId, String expand, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java new file mode 100644 index 0000000000000..c630c6b84d82b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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.compute.generated.fluent.models.VirtualMachineScaleSetVMInner; + +/** Resource collection API of VirtualMachineScaleSetVMs. */ +public interface VirtualMachineScaleSetVMs { + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param vmScaleSetVMReimageInput Parameters for the Reimaging Virtual machine in ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput, + Context context); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + VirtualMachineScaleSetVM update( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters); + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + VirtualMachineScaleSetVM update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String instanceId, Boolean forceDeletion); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param forceDeletion Optional parameter to force delete a virtual machine from a VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, String instanceId, Boolean forceDeletion, Context context); + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + VirtualMachineScaleSetVM get(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of + * the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + Response getWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context); + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + VirtualMachineScaleSetVMInstanceView getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a virtual machine from a VM scale set. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + PagedIterable list(String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, + * 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. + * @param select The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + PagedIterable list( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData( + String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + Integer sasUriExpirationTimeInMinutes, + Context context); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void simulateEviction(String resourceGroupName, String vmScaleSetName, String instanceId); + + /** + * The operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response simulateEvictionWithResponse( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + RunCommandResult runCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters); + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java new file mode 100644 index 0000000000000..c43c3a8cb717e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java @@ -0,0 +1,813 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 VirtualMachineScaleSets. */ +public interface VirtualMachineScaleSets { + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + PagedIterable listByLocation(String location); + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VM scale sets under the specified subscription for the specified location. + */ + PagedIterable listByLocation(String location, Context context); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, Boolean forceDeletion); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vmScaleSetName); + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, Boolean forceDeletion, Context context); + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + VirtualMachineScaleSet getByResourceGroup(String resourceGroupName, String vmScaleSetName); + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmScaleSetName, ExpandTypesForGetVMScaleSets expand, Context context); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmScaleSetName); + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param forceDeletion Optional parameter to force delete virtual machines from the VM scale set. (Feature in + * Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Boolean forceDeletion, + Context context); + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + VirtualMachineScaleSetInstanceView getInstanceView(String resourceGroupName, String vmScaleSetName); + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of all VM scale sets under 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 a list of all VM scale sets under a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + PagedIterable list(); + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + PagedIterable list(Context context); + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + PagedIterable listSkus(String resourceGroupName, String vmScaleSetName); + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + PagedIterable listSkus(String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of OS upgrades on a VM scale set instance. + */ + PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName); + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 OS upgrades on a VM scale set instance. + */ + PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName, Context context); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String vmScaleSetName); + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmScaleSetName); + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmScaleSetName); + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmScaleSetName); + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(String resourceGroupName, String vmScaleSetName); + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 performMaintenance( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void updateInstances( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs); + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateInstances( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, + Context context); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String vmScaleSetName); + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Parameters for Reimaging VM ScaleSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimageAll(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimageAll(String resourceGroupName, String vmScaleSetName); + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimageAll( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, + Context context); + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + RecoveryWalkResponse forceRecoveryServiceFabricPlatformUpdateDomainWalk( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain); + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + Response forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, VMScaleSetConvertToSinglePlacementGroupInput parameters); + + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for ConvertToSinglePlacementGroup API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + Response convertToSinglePlacementGroupWithResponse( + String resourceGroupName, + String vmScaleSetName, + VMScaleSetConvertToSinglePlacementGroupInput parameters, + Context context); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters); + + /** + * Changes ServiceState property for a given service. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param parameters The input object for SetOrchestrationServiceState API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 setOrchestrationServiceState( + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context); + + /** + * Display information about a virtual machine scale set. + * + * @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 describes a Virtual Machine Scale Set. + */ + VirtualMachineScaleSet getById(String id); + + /** + * Display information about a virtual machine scale set. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the + * VM scale set that was provided by the user during the VM scale set Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine Scale Set. + */ + Response getByIdWithResponse( + String id, ExpandTypesForGetVMScaleSets expand, Context context); + + /** + * Deletes a VM scale set. + * + * @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 VM scale set. + * + * @param id the resource ID. + * @param forceDeletion Optional parameter to force delete a VM scale set. (Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 forceDeletion, Context context); + + /** + * Begins definition for a new VirtualMachineScaleSet resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachineScaleSet definition. + */ + VirtualMachineScaleSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java new file mode 100644 index 0000000000000..8ffc12b7aadfa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; + +/** An immutable client-side representation of VirtualMachineSize. */ +public interface VirtualMachineSize { + /** + * Gets the name property: The name of the virtual machine size. + * + * @return the name value. + */ + String name(); + + /** + * Gets the numberOfCores property: The number of cores supported by the virtual machine size. For Constrained vCPU + * capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, + * please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or + * https://docs.microsoft.com/rest/api/compute/resourceskus/list. + * + * @return the numberOfCores value. + */ + Integer numberOfCores(); + + /** + * Gets the osDiskSizeInMB property: The OS disk size, in MB, allowed by the virtual machine size. + * + * @return the osDiskSizeInMB value. + */ + Integer osDiskSizeInMB(); + + /** + * Gets the resourceDiskSizeInMB property: The resource disk size, in MB, allowed by the virtual machine size. + * + * @return the resourceDiskSizeInMB value. + */ + Integer resourceDiskSizeInMB(); + + /** + * Gets the memoryInMB property: The amount of memory, in MB, supported by the virtual machine size. + * + * @return the memoryInMB value. + */ + Integer memoryInMB(); + + /** + * Gets the maxDataDiskCount property: The maximum number of data disks that can be attached to the virtual machine + * size. + * + * @return the maxDataDiskCount value. + */ + Integer maxDataDiskCount(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner object. + * + * @return the inner object. + */ + VirtualMachineSizeInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.java new file mode 100644 index 0000000000000..496d3d07cb5e7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeListResult.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Virtual Machine operation response. */ +@Fluent +public final class VirtualMachineSizeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSizeListResult.class); + + /* + * The list of virtual machine sizes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of virtual machine sizes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine sizes. + * + * @param value the value value to set. + * @return the VirtualMachineSizeListResult object itself. + */ + public VirtualMachineSizeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeTypes.java new file mode 100644 index 0000000000000..70e24121b0664 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizeTypes.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualMachineSizeTypes. */ +public final class VirtualMachineSizeTypes extends ExpandableStringEnum { + /** Static value Basic_A0 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes BASIC_A0 = fromString("Basic_A0"); + + /** Static value Basic_A1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes BASIC_A1 = fromString("Basic_A1"); + + /** Static value Basic_A2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes BASIC_A2 = fromString("Basic_A2"); + + /** Static value Basic_A3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes BASIC_A3 = fromString("Basic_A3"); + + /** Static value Basic_A4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes BASIC_A4 = fromString("Basic_A4"); + + /** Static value Standard_A0 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A0 = fromString("Standard_A0"); + + /** Static value Standard_A1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A1 = fromString("Standard_A1"); + + /** Static value Standard_A2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A2 = fromString("Standard_A2"); + + /** Static value Standard_A3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A3 = fromString("Standard_A3"); + + /** Static value Standard_A4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A4 = fromString("Standard_A4"); + + /** Static value Standard_A5 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A5 = fromString("Standard_A5"); + + /** Static value Standard_A6 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A6 = fromString("Standard_A6"); + + /** Static value Standard_A7 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A7 = fromString("Standard_A7"); + + /** Static value Standard_A8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A8 = fromString("Standard_A8"); + + /** Static value Standard_A9 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A9 = fromString("Standard_A9"); + + /** Static value Standard_A10 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A10 = fromString("Standard_A10"); + + /** Static value Standard_A11 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A11 = fromString("Standard_A11"); + + /** Static value Standard_A1_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A1_V2 = fromString("Standard_A1_v2"); + + /** Static value Standard_A2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A2_V2 = fromString("Standard_A2_v2"); + + /** Static value Standard_A4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A4_V2 = fromString("Standard_A4_v2"); + + /** Static value Standard_A8_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A8_V2 = fromString("Standard_A8_v2"); + + /** Static value Standard_A2m_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); + + /** Static value Standard_A4m_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); + + /** Static value Standard_A8m_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); + + /** Static value Standard_B1s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B1S = fromString("Standard_B1s"); + + /** Static value Standard_B1ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B1MS = fromString("Standard_B1ms"); + + /** Static value Standard_B2s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B2S = fromString("Standard_B2s"); + + /** Static value Standard_B2ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B2MS = fromString("Standard_B2ms"); + + /** Static value Standard_B4ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B4MS = fromString("Standard_B4ms"); + + /** Static value Standard_B8ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_B8MS = fromString("Standard_B8ms"); + + /** Static value Standard_D1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D1 = fromString("Standard_D1"); + + /** Static value Standard_D2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D2 = fromString("Standard_D2"); + + /** Static value Standard_D3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D3 = fromString("Standard_D3"); + + /** Static value Standard_D4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D4 = fromString("Standard_D4"); + + /** Static value Standard_D11 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D11 = fromString("Standard_D11"); + + /** Static value Standard_D12 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D12 = fromString("Standard_D12"); + + /** Static value Standard_D13 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D13 = fromString("Standard_D13"); + + /** Static value Standard_D14 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D14 = fromString("Standard_D14"); + + /** Static value Standard_D1_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); + + /** Static value Standard_D2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); + + /** Static value Standard_D3_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); + + /** Static value Standard_D4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); + + /** Static value Standard_D5_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); + + /** Static value Standard_D2_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D2_V3 = fromString("Standard_D2_v3"); + + /** Static value Standard_D4_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D4_V3 = fromString("Standard_D4_v3"); + + /** Static value Standard_D8_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D8_V3 = fromString("Standard_D8_v3"); + + /** Static value Standard_D16_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D16_V3 = fromString("Standard_D16_v3"); + + /** Static value Standard_D32_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D32_V3 = fromString("Standard_D32_v3"); + + /** Static value Standard_D64_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D64_V3 = fromString("Standard_D64_v3"); + + /** Static value Standard_D2s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); + + /** Static value Standard_D4s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); + + /** Static value Standard_D8s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); + + /** Static value Standard_D16s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); + + /** Static value Standard_D32s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); + + /** Static value Standard_D64s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); + + /** Static value Standard_D11_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_D13_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_D14_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D14_V2 = fromString("Standard_D14_v2"); + + /** Static value Standard_D15_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_D15_V2 = fromString("Standard_D15_v2"); + + /** Static value Standard_DS1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS1 = fromString("Standard_DS1"); + + /** Static value Standard_DS2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS2 = fromString("Standard_DS2"); + + /** Static value Standard_DS3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS3 = fromString("Standard_DS3"); + + /** Static value Standard_DS4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS4 = fromString("Standard_DS4"); + + /** Static value Standard_DS11 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS11 = fromString("Standard_DS11"); + + /** Static value Standard_DS12 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS12 = fromString("Standard_DS12"); + + /** Static value Standard_DS13 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS13 = fromString("Standard_DS13"); + + /** Static value Standard_DS14 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS14 = fromString("Standard_DS14"); + + /** Static value Standard_DS1_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); + + /** Static value Standard_DS2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); + + /** Static value Standard_DS3_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); + + /** Static value Standard_DS4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); + + /** Static value Standard_DS5_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); + + /** Static value Standard_DS11_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); + + /** Static value Standard_DS12_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); + + /** Static value Standard_DS13_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); + + /** Static value Standard_DS14_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); + + /** Static value Standard_DS15_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); + + /** Static value Standard_DS13-4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS13_4_V2 = fromString("Standard_DS13-4_v2"); + + /** Static value Standard_DS13-2_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS13_2_V2 = fromString("Standard_DS13-2_v2"); + + /** Static value Standard_DS14-8_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS14_8_V2 = fromString("Standard_DS14-8_v2"); + + /** Static value Standard_DS14-4_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_DS14_4_V2 = fromString("Standard_DS14-4_v2"); + + /** Static value Standard_E2_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E2_V3 = fromString("Standard_E2_v3"); + + /** Static value Standard_E4_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E4_V3 = fromString("Standard_E4_v3"); + + /** Static value Standard_E8_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E8_V3 = fromString("Standard_E8_v3"); + + /** Static value Standard_E16_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E16_V3 = fromString("Standard_E16_v3"); + + /** Static value Standard_E32_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E32_V3 = fromString("Standard_E32_v3"); + + /** Static value Standard_E64_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E64_V3 = fromString("Standard_E64_v3"); + + /** Static value Standard_E2s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); + + /** Static value Standard_E4s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); + + /** Static value Standard_E8s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); + + /** Static value Standard_E16s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); + + /** Static value Standard_E32s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); + + /** Static value Standard_E64s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); + + /** Static value Standard_E32-16_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E32_16_V3 = fromString("Standard_E32-16_v3"); + + /** Static value Standard_E32-8s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E32_8S_V3 = fromString("Standard_E32-8s_v3"); + + /** Static value Standard_E64-32s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E64_32S_V3 = fromString("Standard_E64-32s_v3"); + + /** Static value Standard_E64-16s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_E64_16S_V3 = fromString("Standard_E64-16s_v3"); + + /** Static value Standard_F1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F1 = fromString("Standard_F1"); + + /** Static value Standard_F2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F2 = fromString("Standard_F2"); + + /** Static value Standard_F4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F4 = fromString("Standard_F4"); + + /** Static value Standard_F8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F8 = fromString("Standard_F8"); + + /** Static value Standard_F16 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F16 = fromString("Standard_F16"); + + /** Static value Standard_F1s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F1S = fromString("Standard_F1s"); + + /** Static value Standard_F2s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F2S = fromString("Standard_F2s"); + + /** Static value Standard_F4s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F4S = fromString("Standard_F4s"); + + /** Static value Standard_F8s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F8S = fromString("Standard_F8s"); + + /** Static value Standard_F16s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F16S = fromString("Standard_F16s"); + + /** Static value Standard_F2s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); + + /** Static value Standard_F4s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); + + /** Static value Standard_F8s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); + + /** Static value Standard_F16s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); + + /** Static value Standard_F32s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); + + /** Static value Standard_F64s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); + + /** Static value Standard_F72s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); + + /** Static value Standard_G1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_G1 = fromString("Standard_G1"); + + /** Static value Standard_G2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_G2 = fromString("Standard_G2"); + + /** Static value Standard_G3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_G3 = fromString("Standard_G3"); + + /** Static value Standard_G4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_G4 = fromString("Standard_G4"); + + /** Static value Standard_G5 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_G5 = fromString("Standard_G5"); + + /** Static value Standard_GS1 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS1 = fromString("Standard_GS1"); + + /** Static value Standard_GS2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS2 = fromString("Standard_GS2"); + + /** Static value Standard_GS3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS3 = fromString("Standard_GS3"); + + /** Static value Standard_GS4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS4 = fromString("Standard_GS4"); + + /** Static value Standard_GS5 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS5 = fromString("Standard_GS5"); + + /** Static value Standard_GS4-8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS4_8 = fromString("Standard_GS4-8"); + + /** Static value Standard_GS4-4 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS4_4 = fromString("Standard_GS4-4"); + + /** Static value Standard_GS5-16 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS5_16 = fromString("Standard_GS5-16"); + + /** Static value Standard_GS5-8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_GS5_8 = fromString("Standard_GS5-8"); + + /** Static value Standard_H8 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H8 = fromString("Standard_H8"); + + /** Static value Standard_H16 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H16 = fromString("Standard_H16"); + + /** Static value Standard_H8m for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H8M = fromString("Standard_H8m"); + + /** Static value Standard_H16m for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H16M = fromString("Standard_H16m"); + + /** Static value Standard_H16r for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H16R = fromString("Standard_H16r"); + + /** Static value Standard_H16mr for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_H16MR = fromString("Standard_H16mr"); + + /** Static value Standard_L4s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Standard_L8s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_L16s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_L32s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_L32S = fromString("Standard_L32s"); + + /** Static value Standard_M64s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M64S = fromString("Standard_M64s"); + + /** Static value Standard_M64ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M64MS = fromString("Standard_M64ms"); + + /** Static value Standard_M128s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M128S = fromString("Standard_M128s"); + + /** Static value Standard_M128ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M128MS = fromString("Standard_M128ms"); + + /** Static value Standard_M64-32ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M64_32MS = fromString("Standard_M64-32ms"); + + /** Static value Standard_M64-16ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M64_16MS = fromString("Standard_M64-16ms"); + + /** Static value Standard_M128-64ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M128_64MS = fromString("Standard_M128-64ms"); + + /** Static value Standard_M128-32ms for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_M128_32MS = fromString("Standard_M128-32ms"); + + /** Static value Standard_NC6 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC6 = fromString("Standard_NC6"); + + /** Static value Standard_NC12 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC12 = fromString("Standard_NC12"); + + /** Static value Standard_NC24 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24 = fromString("Standard_NC24"); + + /** Static value Standard_NC24r for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24R = fromString("Standard_NC24r"); + + /** Static value Standard_NC6s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC6S_V2 = fromString("Standard_NC6s_v2"); + + /** Static value Standard_NC12s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC12S_V2 = fromString("Standard_NC12s_v2"); + + /** Static value Standard_NC24s_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24S_V2 = fromString("Standard_NC24s_v2"); + + /** Static value Standard_NC24rs_v2 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24RS_V2 = fromString("Standard_NC24rs_v2"); + + /** Static value Standard_NC6s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC6S_V3 = fromString("Standard_NC6s_v3"); + + /** Static value Standard_NC12s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC12S_V3 = fromString("Standard_NC12s_v3"); + + /** Static value Standard_NC24s_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24S_V3 = fromString("Standard_NC24s_v3"); + + /** Static value Standard_NC24rs_v3 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NC24RS_V3 = fromString("Standard_NC24rs_v3"); + + /** Static value Standard_ND6s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_ND6S = fromString("Standard_ND6s"); + + /** Static value Standard_ND12s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_ND12S = fromString("Standard_ND12s"); + + /** Static value Standard_ND24s for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_ND24S = fromString("Standard_ND24s"); + + /** Static value Standard_ND24rs for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_ND24RS = fromString("Standard_ND24rs"); + + /** Static value Standard_NV6 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NV6 = fromString("Standard_NV6"); + + /** Static value Standard_NV12 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NV12 = fromString("Standard_NV12"); + + /** Static value Standard_NV24 for VirtualMachineSizeTypes. */ + public static final VirtualMachineSizeTypes STANDARD_NV24 = fromString("Standard_NV24"); + + /** + * Creates or finds a VirtualMachineSizeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineSizeTypes. + */ + @JsonCreator + public static VirtualMachineSizeTypes fromString(String name) { + return fromString(name, VirtualMachineSizeTypes.class); + } + + /** @return known VirtualMachineSizeTypes values. */ + public static Collection values() { + return values(VirtualMachineSizeTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizes.java new file mode 100644 index 0000000000000..ec0be30c15e86 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachineSizes. */ +public interface VirtualMachineSizes { + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable list(String location); + + /** + * This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSoftwarePatchProperties.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSoftwarePatchProperties.java new file mode 100644 index 0000000000000..46e4233a9a806 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSoftwarePatchProperties.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a Virtual Machine software patch. */ +@Immutable +public final class VirtualMachineSoftwarePatchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineSoftwarePatchProperties.class); + + /* + * A unique identifier for the patch. + */ + @JsonProperty(value = "patchId", access = JsonProperty.Access.WRITE_ONLY) + private String patchId; + + /* + * The friendly name of the patch. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The version number of the patch. This property applies only to Linux + * patches. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The KBID of the patch. Only applies to Windows patches. + */ + @JsonProperty(value = "kbId", access = JsonProperty.Access.WRITE_ONLY) + private String kbId; + + /* + * The classification(s) of the patch as provided by the patch publisher. + */ + @JsonProperty(value = "classifications", access = JsonProperty.Access.WRITE_ONLY) + private List classifications; + + /* + * Describes the reboot requirements of the patch. + */ + @JsonProperty(value = "rebootBehavior", access = JsonProperty.Access.WRITE_ONLY) + private VMGuestPatchRebootBehavior rebootBehavior; + + /* + * The activity ID of the operation that produced this result. It is used + * to correlate across CRP and extension logs. + */ + @JsonProperty(value = "activityId", access = JsonProperty.Access.WRITE_ONLY) + private String activityId; + + /* + * The UTC timestamp when the repository published this patch. + */ + @JsonProperty(value = "publishedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime publishedDate; + + /* + * The UTC timestamp of the last update to this patch record. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * Describes the availability of a given patch. + */ + @JsonProperty(value = "assessmentState", access = JsonProperty.Access.WRITE_ONLY) + private PatchAssessmentState assessmentState; + + /** + * Get the patchId property: A unique identifier for the patch. + * + * @return the patchId value. + */ + public String patchId() { + return this.patchId; + } + + /** + * Get the name property: The friendly name of the patch. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the version property: The version number of the patch. This property applies only to Linux patches. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the kbId property: The KBID of the patch. Only applies to Windows patches. + * + * @return the kbId value. + */ + public String kbId() { + return this.kbId; + } + + /** + * Get the classifications property: The classification(s) of the patch as provided by the patch publisher. + * + * @return the classifications value. + */ + public List classifications() { + return this.classifications; + } + + /** + * Get the rebootBehavior property: Describes the reboot requirements of the patch. + * + * @return the rebootBehavior value. + */ + public VMGuestPatchRebootBehavior rebootBehavior() { + return this.rebootBehavior; + } + + /** + * Get the activityId property: The activity ID of the operation that produced this result. It is used to correlate + * across CRP and extension logs. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Get the publishedDate property: The UTC timestamp when the repository published this patch. + * + * @return the publishedDate value. + */ + public OffsetDateTime publishedDate() { + return this.publishedDate; + } + + /** + * Get the lastModifiedDateTime property: The UTC timestamp of the last update to this patch record. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the assessmentState property: Describes the availability of a given patch. + * + * @return the assessmentState value. + */ + public PatchAssessmentState assessmentState() { + return this.assessmentState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineStatusCodeCount.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineStatusCodeCount.java new file mode 100644 index 0000000000000..2ac589c0f18da --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineStatusCodeCount.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.compute.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The status code and count of the virtual machine scale set instance view status summary. */ +@Immutable +public final class VirtualMachineStatusCodeCount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineStatusCodeCount.class); + + /* + * The instance view status code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The number of instances having a particular status code. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** + * Get the code property: The instance view status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the count property: The number of instances having a particular status code. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java new file mode 100644 index 0000000000000..c8db601624081 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachineUpdate. */ +public interface VirtualMachineUpdate { + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the plan property: Specifies information about the marketplace image used to create the virtual machine. + * This element is only used for marketplace images. Before you can use a marketplace image from an API, you must + * enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and + * then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click + * **Save**. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the identity property: The identity of the virtual machine, if configured. + * + * @return the identity value. + */ + VirtualMachineIdentity identity(); + + /** + * Gets the zones property: The virtual machine zones. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the hardwareProfile property: Specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value. + */ + HardwareProfile hardwareProfile(); + + /** + * Gets the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * Gets the additionalCapabilities property: Specifies additional capabilities enabled or disabled on the virtual + * machine. + * + * @return the additionalCapabilities value. + */ + AdditionalCapabilities additionalCapabilities(); + + /** + * Gets the osProfile property: Specifies the operating system settings used while creating the virtual machine. + * Some of the settings cannot be changed once VM is provisioned. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the networkProfile property: Specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the securityProfile property: Specifies the Security related profile settings for the virtual machine. + * + * @return the securityProfile value. + */ + SecurityProfile securityProfile(); + + /** + * Gets the diagnosticsProfile property: Specifies the boot diagnostic settings state. <br><br>Minimum + * api-version: 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + DiagnosticsProfile diagnosticsProfile(); + + /** + * Gets the availabilitySet property: Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes + * to maximize availability. For more information about availability sets, see [Availability sets + * overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For + * more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, + * a VM can only be added to availability set at creation time. The availability set to which the VM is being added + * should be under the same resource group as the availability set resource. An existing VM cannot be added to an + * availability set. <br><br>This property cannot exist along with a non-null + * properties.virtualMachineScaleSet reference. + * + * @return the availabilitySet value. + */ + SubResource availabilitySet(); + + /** + * Gets the virtualMachineScaleSet property: Specifies information about the virtual machine scale set that the + * virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are + * allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale + * set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This + * property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum + * api‐version: 2019‐03‐01. + * + * @return the virtualMachineScaleSet value. + */ + SubResource virtualMachineScaleSet(); + + /** + * Gets the proximityPlacementGroup property: Specifies information about the proximity placement group that the + * virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. + * + * @return the proximityPlacementGroup value. + */ + SubResource proximityPlacementGroup(); + + /** + * Gets the priority property: Specifies the priority for the virtual machine. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the priority value. + */ + VirtualMachinePriorityTypes priority(); + + /** + * Gets the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and + * the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and + * 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + VirtualMachineEvictionPolicyTypes evictionPolicy(); + + /** + * Gets the billingProfile property: Specifies the billing related details of a Azure Spot virtual machine. + * <br><br>Minimum api-version: 2019-03-01. + * + * @return the billingProfile value. + */ + BillingProfile billingProfile(); + + /** + * Gets the host property: Specifies information about the dedicated host that the virtual machine resides in. + * <br><br>Minimum api-version: 2018-10-01. + * + * @return the host value. + */ + SubResource host(); + + /** + * Gets the hostGroup property: Specifies information about the dedicated host group that the virtual machine + * resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify + * both host and hostGroup properties. + * + * @return the hostGroup value. + */ + SubResource hostGroup(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The virtual machine instance view. + * + * @return the instanceView value. + */ + VirtualMachineInstanceView instanceView(); + + /** + * Gets the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + String licenseType(); + + /** + * Gets the vmId property: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in + * all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + String extensionsTimeBudget(); + + /** + * Gets the platformFaultDomain property: Specifies the scale set logical fault domain into which the Virtual + * Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that + * best maintains balance across available fault domains.<br><li>This is applicable only if the + * 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is + * referenced, must have 'platformFaultDomainCount' &gt; 1.<li>This property cannot be updated once the + * Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance + * View.<br><br>Minimum api‐version: 2020‐12‐01. + * + * @return the platformFaultDomain value. + */ + Integer platformFaultDomain(); + + /** + * Gets the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + ScheduledEventsProfile scheduledEventsProfile(); + + /** + * Gets the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any + * secrets in here. <br><br>Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the capacityReservation property: Specifies information about the capacity reservation that is used to + * allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + CapacityReservationProfile capacityReservation(); + + /** + * Gets the inner com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineUpdateInner object. + * + * @return the inner object. + */ + VirtualMachineUpdateInner innerModel(); +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java new file mode 100644 index 0000000000000..d64eea49ff95c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.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 { + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + PagedIterable listByLocation(String location); + + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + PagedIterable listByLocation(String location, Context context); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters); + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + VirtualMachineCaptureResult capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, Boolean forceDeletion); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vmName); + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 vmName, Boolean forceDeletion, Context context); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + VirtualMachine getByResourceGroup(String resourceGroupName, String vmName); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context); + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + VirtualMachineInstanceView instanceView(String resourceGroupName, String vmName); + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the instance view of a virtual machine. + */ + Response instanceViewWithResponse( + String resourceGroupName, String vmName, Context context); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void convertToManagedDisks(String resourceGroupName, String vmName); + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void convertToManagedDisks(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deallocate(String resourceGroupName, String vmName, Context context); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generalize(String resourceGroupName, String vmName); + + /** + * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before + * performing this operation. <br>For Windows, please refer to [Create a managed image of a generalized VM in + * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).<br>For Linux, + * please refer to [How to create an image of a virtual machine or + * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response generalizeWithResponse(String resourceGroupName, String vmName, Context context); + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @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 the List Virtual Machine operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable list(); + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param statusOnly statusOnly=true enables fetching run time status of all Virtual Machines in the 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 List Virtual Machine operation response. + */ + PagedIterable list(String statusOnly, Context context); + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable listAvailableSizes(String resourceGroupName, String vmName); + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + PagedIterable listAvailableSizes(String resourceGroupName, String vmName, Context context); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void powerOff(String resourceGroupName, String vmName); + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(String resourceGroupName, String vmName); + + /** + * The operation to reapply a virtual machine's state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reapply(String resourceGroupName, String vmName, Context context); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmName); + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String vmName, Context context); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmName); + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String vmName, Context context); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmName); + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void redeploy(String resourceGroupName, String vmName, Context context); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String vmName); + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Reimage Virtual Machine operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(String resourceGroupName, String vmName, VirtualMachineReimageParameters parameters, Context context); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + RetrieveBootDiagnosticsDataResult retrieveBootDiagnosticsData(String resourceGroupName, String vmName); + + /** + * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param sasUriExpirationTimeInMinutes Expiration duration in minutes for the SAS URIs with a value between 1 to + * 1440 minutes. <br><br>NOTE: If not specified, SAS URIs will be generated with a default + * expiration duration of 120 minutes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS URIs of the console screenshot and serial log blobs. + */ + Response retrieveBootDiagnosticsDataWithResponse( + String resourceGroupName, String vmName, Integer sasUriExpirationTimeInMinutes, Context context); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(String resourceGroupName, String vmName); + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void performMaintenance(String resourceGroupName, String vmName, Context context); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void simulateEviction(String resourceGroupName, String vmName); + + /** + * The operation to simulate the eviction of spot virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response simulateEvictionWithResponse(String resourceGroupName, String vmName, Context context); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String vmName); + + /** + * Assess patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the properties of an AssessPatches result. + */ + VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String vmName, Context context); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches( + String resourceGroupName, String vmName, VirtualMachineInstallPatchesParameters installPatchesInput); + + /** + * Installs patches on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param installPatchesInput Input for InstallPatches as directly received by the API. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result summary of an installation operation. + */ + VirtualMachineInstallPatchesResult installPatches( + String resourceGroupName, + String vmName, + VirtualMachineInstallPatchesParameters installPatchesInput, + Context context); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + RunCommandResult runCommand(String resourceGroupName, String vmName, RunCommandInput parameters); + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Run command operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + RunCommandResult runCommand(String resourceGroupName, String vmName, RunCommandInput parameters, Context context); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + VirtualMachine getById(String id); + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param id the resource ID. + * @param expand The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime + * properties of the virtual machine that is managed by the platform and can change outside of control plane + * operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the + * user during the VM Create/Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + Response getByIdWithResponse(String id, InstanceViewTypes expand, Context context); + + /** + * The operation to delete a virtual machine. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The operation to delete a virtual machine. + * + * @param id the resource ID. + * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 forceDeletion, 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/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmDiskTypes.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmDiskTypes.java new file mode 100644 index 0000000000000..d587e52786d22 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VmDiskTypes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VmDiskTypes. */ +public final class VmDiskTypes extends ExpandableStringEnum { + /** Static value None for VmDiskTypes. */ + public static final VmDiskTypes NONE = fromString("None"); + + /** Static value Unmanaged for VmDiskTypes. */ + public static final VmDiskTypes UNMANAGED = fromString("Unmanaged"); + + /** + * Creates or finds a VmDiskTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VmDiskTypes. + */ + @JsonCreator + public static VmDiskTypes fromString(String name) { + return fromString(name, VmDiskTypes.class); + } + + /** @return known VmDiskTypes values. */ + public static Collection values() { + return values(VmDiskTypes.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMConfiguration.java new file mode 100644 index 0000000000000..7dd6e779a84fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMConfiguration.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.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes Windows Remote Management configuration of the VM. */ +@Fluent +public final class WinRMConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WinRMConfiguration.class); + + /* + * The list of Windows Remote Management listeners + */ + @JsonProperty(value = "listeners") + private List listeners; + + /** + * Get the listeners property: The list of Windows Remote Management listeners. + * + * @return the listeners value. + */ + public List listeners() { + return this.listeners; + } + + /** + * Set the listeners property: The list of Windows Remote Management listeners. + * + * @param listeners the listeners value to set. + * @return the WinRMConfiguration object itself. + */ + public WinRMConfiguration withListeners(List listeners) { + this.listeners = listeners; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listeners() != null) { + listeners().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.java new file mode 100644 index 0000000000000..2dafb6c32fd54 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WinRMListener.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Protocol and thumbprint of Windows Remote Management listener. */ +@Fluent +public final class WinRMListener { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WinRMListener.class); + + /* + * Specifies the protocol of WinRM listener.

    Possible values are: + *
    **http**

    **https** + */ + @JsonProperty(value = "protocol") + private ProtocolTypes protocol; + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as + * a secret. For adding a secret to the Key Vault, see [Add a key or secret + * to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

    {
    + * "data":"",
    "dataType":"pfx",
    + * "password":""
    } + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /** + * Get the protocol property: Specifies the protocol of WinRM listener. <br><br> Possible values are: + * <br>**http** <br><br> **https**. + * + * @return the protocol value. + */ + public ProtocolTypes protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Specifies the protocol of WinRM listener. <br><br> Possible values are: + * <br>**http** <br><br> **https**. + * + * @param protocol the protocol value to set. + * @return the WinRMListener object itself. + */ + public WinRMListener withProtocol(ProtocolTypes protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @param certificateUrl the certificateUrl value to set. + * @return the WinRMListener object itself. + */ + public WinRMListener withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.java new file mode 100644 index 0000000000000..b5150c6bb003e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsConfiguration.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies Windows operating system settings on the virtual machine. */ +@Fluent +public final class WindowsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsConfiguration.class); + + /* + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Indicates whether Automatic Updates is enabled for the Windows virtual + * machine. Default value is true.

    For virtual machine scale sets, + * this property can be updated and updates will take effect on OS + * reprovisioning. + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /* + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard + * Time".

    Possible values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + * value from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Specifies additional base-64 encoded XML formatted information that can + * be included in the Unattend.xml file, which is used by Windows Setup. + */ + @JsonProperty(value = "additionalUnattendContent") + private List additionalUnattendContent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on + * Windows. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings patchSettings; + + /* + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + */ + @JsonProperty(value = "winRM") + private WinRMConfiguration winRM; + + /** + * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. <br><br> When this property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM + * later. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. <br><br> When this property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM + * later. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual + * machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated + * and updates will take effect on OS reprovisioning. + * + * @return the enableAutomaticUpdates value. + */ + public Boolean enableAutomaticUpdates() { + return this.enableAutomaticUpdates; + } + + /** + * Set the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual + * machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated + * and updates will take effect on OS reprovisioning. + * + * @param enableAutomaticUpdates the enableAutomaticUpdates value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withEnableAutomaticUpdates(Boolean enableAutomaticUpdates) { + this.enableAutomaticUpdates = enableAutomaticUpdates; + return this; + } + + /** + * Get the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + * <br><br> Possible values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + * <br><br> Possible values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @param timeZone the timeZone value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @return the additionalUnattendContent value. + */ + public List additionalUnattendContent() { + return this.additionalUnattendContent; + } + + /** + * Set the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @param additionalUnattendContent the additionalUnattendContent value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withAdditionalUnattendContent( + List additionalUnattendContent) { + this.additionalUnattendContent = additionalUnattendContent; + return this; + } + + /** + * Get the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @return the patchSettings value. + */ + public PatchSettings patchSettings() { + return this.patchSettings; + } + + /** + * Set the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @param patchSettings the patchSettings value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withPatchSettings(PatchSettings patchSettings) { + this.patchSettings = patchSettings; + return this; + } + + /** + * Get the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @return the winRM value. + */ + public WinRMConfiguration winRM() { + return this.winRM; + } + + /** + * Set the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param winRM the winRM value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withWinRM(WinRMConfiguration winRM) { + this.winRM = winRM; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalUnattendContent() != null) { + additionalUnattendContent().forEach(e -> e.validate()); + } + if (patchSettings() != null) { + patchSettings().validate(); + } + if (winRM() != null) { + winRM().validate(); + } + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java new file mode 100644 index 0000000000000..d3b8df865dcb7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsParameters.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Input for InstallPatches on a Windows VM, as directly received by the API. */ +@Fluent +public final class WindowsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WindowsParameters.class); + + /* + * The update classifications to select when installing patches for + * Windows. + */ + @JsonProperty(value = "classificationsToInclude") + private List classificationsToInclude; + + /* + * Kbs to include in the patch operation + */ + @JsonProperty(value = "kbNumbersToInclude") + private List kbNumbersToInclude; + + /* + * Kbs to exclude in the patch operation + */ + @JsonProperty(value = "kbNumbersToExclude") + private List kbNumbersToExclude; + + /* + * Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + */ + @JsonProperty(value = "excludeKbsRequiringReboot") + private Boolean excludeKbsRequiringReboot; + + /* + * This is used to install patches that were published on or before this + * given max published date. + */ + @JsonProperty(value = "maxPatchPublishDate") + private OffsetDateTime maxPatchPublishDate; + + /** + * Get the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @return the classificationsToInclude value. + */ + public List classificationsToInclude() { + return this.classificationsToInclude; + } + + /** + * Set the classificationsToInclude property: The update classifications to select when installing patches for + * Windows. + * + * @param classificationsToInclude the classificationsToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withClassificationsToInclude( + List classificationsToInclude) { + this.classificationsToInclude = classificationsToInclude; + return this; + } + + /** + * Get the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @return the kbNumbersToInclude value. + */ + public List kbNumbersToInclude() { + return this.kbNumbersToInclude; + } + + /** + * Set the kbNumbersToInclude property: Kbs to include in the patch operation. + * + * @param kbNumbersToInclude the kbNumbersToInclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToInclude(List kbNumbersToInclude) { + this.kbNumbersToInclude = kbNumbersToInclude; + return this; + } + + /** + * Get the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @return the kbNumbersToExclude value. + */ + public List kbNumbersToExclude() { + return this.kbNumbersToExclude; + } + + /** + * Set the kbNumbersToExclude property: Kbs to exclude in the patch operation. + * + * @param kbNumbersToExclude the kbNumbersToExclude value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withKbNumbersToExclude(List kbNumbersToExclude) { + this.kbNumbersToExclude = kbNumbersToExclude; + return this; + } + + /** + * Get the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @return the excludeKbsRequiringReboot value. + */ + public Boolean excludeKbsRequiringReboot() { + return this.excludeKbsRequiringReboot; + } + + /** + * Set the excludeKbsRequiringReboot property: Filters out Kbs that don't have an InstallationRebootBehavior of + * 'NeverReboots' when this is set to true. + * + * @param excludeKbsRequiringReboot the excludeKbsRequiringReboot value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withExcludeKbsRequiringReboot(Boolean excludeKbsRequiringReboot) { + this.excludeKbsRequiringReboot = excludeKbsRequiringReboot; + return this; + } + + /** + * Get the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @return the maxPatchPublishDate value. + */ + public OffsetDateTime maxPatchPublishDate() { + return this.maxPatchPublishDate; + } + + /** + * Set the maxPatchPublishDate property: This is used to install patches that were published on or before this given + * max published date. + * + * @param maxPatchPublishDate the maxPatchPublishDate value to set. + * @return the WindowsParameters object itself. + */ + public WindowsParameters withMaxPatchPublishDate(OffsetDateTime maxPatchPublishDate) { + this.maxPatchPublishDate = maxPatchPublishDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java new file mode 100644 index 0000000000000..db488817c4e3e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsPatchAssessmentMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WindowsPatchAssessmentMode. */ +public final class WindowsPatchAssessmentMode extends ExpandableStringEnum { + /** Static value ImageDefault for WindowsPatchAssessmentMode. */ + public static final WindowsPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for WindowsPatchAssessmentMode. */ + public static final WindowsPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates or finds a WindowsPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsPatchAssessmentMode. + */ + @JsonCreator + public static WindowsPatchAssessmentMode fromString(String name) { + return fromString(name, WindowsPatchAssessmentMode.class); + } + + /** @return known WindowsPatchAssessmentMode values. */ + public static Collection values() { + return values(WindowsPatchAssessmentMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchMode.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchMode.java new file mode 100644 index 0000000000000..d91b8e7ba84e7 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/WindowsVMGuestPatchMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WindowsVMGuestPatchMode. */ +public final class WindowsVMGuestPatchMode extends ExpandableStringEnum { + /** Static value Manual for WindowsVMGuestPatchMode. */ + public static final WindowsVMGuestPatchMode MANUAL = fromString("Manual"); + + /** Static value AutomaticByOS for WindowsVMGuestPatchMode. */ + public static final WindowsVMGuestPatchMode AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** Static value AutomaticByPlatform for WindowsVMGuestPatchMode. */ + public static final WindowsVMGuestPatchMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates or finds a WindowsVMGuestPatchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsVMGuestPatchMode. + */ + @JsonCreator + public static WindowsVMGuestPatchMode fromString(String name) { + return fromString(name, WindowsVMGuestPatchMode.class); + } + + /** @return known WindowsVMGuestPatchMode values. */ + public static Collection values() { + return values(WindowsVMGuestPatchMode.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/package-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/package-info.java new file mode 100644 index 0000000000000..37e50ec14e516 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ComputeManagementClient. Compute Client. */ +package com.azure.resourcemanager.compute.generated.models; diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/package-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/package-info.java new file mode 100644 index 0000000000000..f96b736c986b5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ComputeManagementClient. Compute Client. */ +package com.azure.resourcemanager.compute.generated; diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/module-info.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..da13320a40242 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.compute.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.compute.generated; + exports com.azure.resourcemanager.compute.generated.fluent; + exports com.azure.resourcemanager.compute.generated.fluent.models; + exports com.azure.resourcemanager.compute.generated.models; + + opens com.azure.resourcemanager.compute.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.compute.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/compute/ci.yml b/sdk/compute/ci.yml new file mode 100644 index 0000000000000..cfac2dc7be563 --- /dev/null +++ b/sdk/compute/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: compute + Artifacts: + - name: azure-resourcemanager-compute-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercomputegenerated diff --git a/sdk/compute/pom.xml b/sdk/compute/pom.xml new file mode 100644 index 0000000000000..8af75841014a6 --- /dev/null +++ b/sdk/compute/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-compute-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-compute-generated + + + +