From ffbe9552dfadfa5cb3502fd88705646cacb1eef8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 19 Mar 2021 01:00:37 +0000 Subject: [PATCH] CodeGen from PR 13509 in Azure/azure-rest-api-specs Merge 0a43d1bdd9d786a3a195852911f49bc022aca5e1 into 6bb9742e375d1d5fae0dd3c8036aa51b396ef0f7 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 67 + .../compute/generated/ComputeManager.java | 662 ++ .../fluent/AvailabilitySetsClient.java | 210 + .../fluent/ComputeManagementClient.java | 299 + .../fluent/DedicatedHostGroupsClient.java | 187 + .../fluent/DedicatedHostsClient.java | 284 + .../generated/fluent/DiskAccessesClient.java | 593 ++ .../fluent/DiskEncryptionSetsClient.java | 370 + .../fluent/DiskRestorePointsClient.java | 100 + .../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/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 | 953 +++ .../fluent/VirtualMachineScaleSetsClient.java | 1385 ++++ .../fluent/VirtualMachineSizesClient.java | 41 + .../fluent/VirtualMachinesClient.java | 1270 ++++ .../fluent/models/AccessUriInner.java | 39 + .../fluent/models/AvailabilitySetInner.java | 218 + .../models/ComputeOperationValueInner.java | 116 + .../models/DedicatedHostGroupInner.java | 182 + .../fluent/models/DedicatedHostInner.java | 258 + .../fluent/models/DiskAccessInner.java | 94 + .../fluent/models/DiskEncryptionSetInner.java | 169 + .../generated/fluent/models/DiskInner.java | 753 ++ .../fluent/models/DiskRestorePointInner.java | 186 + .../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 | 175 + .../LogAnalyticsOperationResultInner.java | 43 + .../PrivateEndpointConnectionInner.java | 107 + .../PrivateLinkResourceListResultInner.java | 55 + .../models/ProximityPlacementGroupInner.java | 167 + .../models/RecoveryWalkResponseInner.java | 56 + .../fluent/models/ResourceSkuInner.java | 246 + ...etrieveBootDiagnosticsDataResultInner.java | 54 + .../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 | 509 ++ ...shPublicKeyGenerateKeyPairResultInner.java | 130 + .../models/SshPublicKeyResourceInner.java | 78 + ...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 | 888 +++ ...rtualMachineInstallPatchesResultInner.java | 235 + .../VirtualMachineInstanceViewInner.java | 465 ++ .../models/VirtualMachineRunCommandInner.java | 328 + .../VirtualMachineScaleSetExtensionInner.java | 341 + .../models/VirtualMachineScaleSetInner.java | 632 ++ ...rtualMachineScaleSetInstanceViewInner.java | 112 + .../VirtualMachineScaleSetSkuInner.java | 77 + ...irtualMachineScaleSetVMExtensionInner.java | 329 + ...neScaleSetVMExtensionsListResultInner.java | 56 + .../models/VirtualMachineScaleSetVMInner.java | 622 ++ ...ualMachineScaleSetVMInstanceViewInner.java | 360 + .../models/VirtualMachineSizeInner.java | 183 + .../models/VirtualMachineUpdateInner.java | 835 +++ .../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 + .../ComputeManagementClientBuilder.java | 149 + .../ComputeManagementClientImpl.java | 789 ++ .../ComputeOperationValueImpl.java | 53 + .../DedicatedHostGroupImpl.java | 242 + .../DedicatedHostGroupsClientImpl.java | 1298 ++++ .../DedicatedHostGroupsImpl.java | 176 + .../implementation/DedicatedHostImpl.java | 259 + .../DedicatedHostsClientImpl.java | 1476 ++++ .../implementation/DedicatedHostsImpl.java | 193 + .../implementation/DiskAccessImpl.java | 197 + .../DiskAccessesClientImpl.java | 2996 ++++++++ .../implementation/DiskAccessesImpl.java | 298 + .../implementation/DiskEncryptionSetImpl.java | 225 + .../DiskEncryptionSetsClientImpl.java | 1978 +++++ .../DiskEncryptionSetsImpl.java | 190 + .../generated/implementation/DiskImpl.java | 469 ++ .../implementation/DiskRestorePointImpl.java | 77 + .../DiskRestorePointsClientImpl.java | 627 ++ .../implementation/DiskRestorePointsImpl.java | 93 + .../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/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 + ...RetrieveBootDiagnosticsDataResultImpl.java | 37 + .../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 | 347 + .../implementation/SnapshotsClientImpl.java | 2099 ++++++ .../implementation/SnapshotsImpl.java | 201 + ...SshPublicKeyGenerateKeyPairResultImpl.java | 41 + .../SshPublicKeyResourceImpl.java | 190 + .../SshPublicKeysClientImpl.java | 1442 ++++ .../implementation/SshPublicKeysImpl.java | 198 + ...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 | 532 ++ ...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 | 422 ++ ...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 | 178 + ...tualMachineScaleSetVMInstanceViewImpl.java | 101 + ...achineScaleSetVMRunCommandsClientImpl.java | 1690 +++++ ...rtualMachineScaleSetVMRunCommandsImpl.java | 164 + .../VirtualMachineScaleSetVMsClientImpl.java | 4529 +++++++++++ .../VirtualMachineScaleSetVMsImpl.java | 308 + .../VirtualMachineScaleSetsClientImpl.java | 6593 +++++++++++++++++ .../VirtualMachineScaleSetsImpl.java | 498 ++ .../VirtualMachineSizeImpl.java | 53 + .../VirtualMachineSizesClientImpl.java | 222 + .../VirtualMachineSizesImpl.java | 47 + .../VirtualMachineUpdateImpl.java | 162 + .../VirtualMachinesClientImpl.java | 6271 ++++++++++++++++ .../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/ComponentNames.java | 44 + .../models/ComputeOperationListResult.java | 44 + .../models/ComputeOperationValue.java | 59 + .../generated/models/CreationData.java | 282 + .../compute/generated/models/DataDisk.java | 431 ++ .../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 | 166 + .../models/DedicatedHostInstanceView.java | 100 + .../DedicatedHostInstanceViewWithName.java | 59 + .../models/DedicatedHostLicenseTypes.java | 50 + .../models/DedicatedHostListResult.java | 88 + .../generated/models/DedicatedHostUpdate.java | 211 + .../generated/models/DedicatedHosts.java | 146 + .../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 | 841 +++ .../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/DiskDetachOptionTypes.java | 31 + .../generated/models/DiskEncryptionSet.java | 287 + .../models/DiskEncryptionSetIdentityType.java | 34 + .../models/DiskEncryptionSetList.java | 88 + .../models/DiskEncryptionSetParameters.java | 35 + .../models/DiskEncryptionSetType.java | 36 + .../models/DiskEncryptionSetUpdate.java | 111 + .../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 | 97 + .../models/DiskRestorePointList.java | 88 + .../generated/models/DiskRestorePoints.java | 93 + .../compute/generated/models/DiskSku.java | 65 + .../compute/generated/models/DiskState.java | 46 + .../models/DiskStorageAccountTypes.java | 40 + .../compute/generated/models/DiskUpdate.java | 501 ++ .../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 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationTypes.java | 31 + .../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 | 82 + .../compute/generated/models/HostCaching.java | 50 + .../generated/models/HyperVGeneration.java | 34 + .../models/HyperVGenerationType.java | 34 + .../models/HyperVGenerationTypes.java | 34 + .../compute/generated/models/Image.java | 309 + .../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 | 134 + .../compute/generated/models/Images.java | 160 + .../compute/generated/models/InnerError.java | 76 + .../generated/models/InstanceViewStatus.java | 155 + .../generated/models/InstanceViewTypes.java | 44 + .../generated/models/IntervalInMins.java | 53 + .../compute/generated/models/IpVersion.java | 34 + .../models/KeyForDiskEncryptionSet.java | 88 + .../models/KeyVaultAndKeyReference.java | 89 + .../models/KeyVaultAndSecretReference.java | 90 + .../models/KeyVaultKeyReference.java | 88 + .../models/KeyVaultSecretReference.java | 89 + .../models/LastPatchInstallationSummary.java | 209 + .../generated/models/LinuxConfiguration.java | 151 + .../generated/models/LinuxParameters.java | 141 + .../generated/models/LinuxPatchSettings.java | 64 + .../models/LinuxVMGuestPatchMode.java | 34 + .../generated/models/ListUsagesResult.java | 89 + .../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 + .../models/NetworkInterfaceReference.java | 63 + .../generated/models/NetworkProfile.java | 57 + .../compute/generated/models/OSDisk.java | 382 + .../compute/generated/models/OSDiskImage.java | 55 + .../models/OSDiskImageEncryption.java | 32 + .../compute/generated/models/OSProfile.java | 410 + .../models/OperatingSystemStateTypes.java | 47 + .../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 | 107 + .../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 + .../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/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 + .../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 + .../RetrieveBootDiagnosticsDataResult.java | 32 + .../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 | 44 + .../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 | 581 ++ .../generated/models/SnapshotList.java | 88 + .../compute/generated/models/SnapshotSku.java | 68 + .../models/SnapshotStorageAccountTypes.java | 37 + .../generated/models/SnapshotUpdate.java | 267 + .../compute/generated/models/Snapshots.java | 214 + .../compute/generated/models/SourceVault.java | 53 + .../generated/models/SshConfiguration.java | 54 + .../generated/models/SshPublicKey.java | 92 + .../SshPublicKeyGenerateKeyPairResult.java | 42 + .../models/SshPublicKeyResource.java | 234 + .../models/SshPublicKeyUpdateResource.java | 72 + .../generated/models/SshPublicKeys.java | 190 + .../models/SshPublicKeysGroupListResult.java | 89 + .../generated/models/StatusLevelTypes.java | 50 + .../generated/models/StorageAccountType.java | 37 + .../generated/models/StorageAccountTypes.java | 40 + .../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/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 | 1105 +++ .../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 + .../models/VirtualMachineListResult.java | 88 + .../models/VirtualMachinePatchStatus.java | 108 + .../models/VirtualMachinePriorityTypes.java | 37 + .../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 | 738 ++ .../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 | 264 + ...aleSetNetworkConfigurationDnsSettings.java | 52 + .../VirtualMachineScaleSetNetworkProfile.java | 91 + .../models/VirtualMachineScaleSetOSDisk.java | 341 + .../VirtualMachineScaleSetOSProfile.java | 320 + ...eScaleSetPublicIpAddressConfiguration.java | 203 + ...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 | 256 + ...alMachineScaleSetUpdateNetworkProfile.java | 91 + .../VirtualMachineScaleSetUpdateOSDisk.java | 205 + ...VirtualMachineScaleSetUpdateOSProfile.java | 138 + ...SetUpdatePublicIpAddressConfiguration.java | 111 + ...alMachineScaleSetUpdateStorageProfile.java | 112 + ...VirtualMachineScaleSetUpdateVMProfile.java | 289 + .../models/VirtualMachineScaleSetVM.java | 227 + .../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 | 390 + ...tualMachineScaleSetVMProtectionPolicy.java | 83 + ...ualMachineScaleSetVMReimageParameters.java | 32 + .../VirtualMachineScaleSetVMRunCommands.java | 201 + .../models/VirtualMachineScaleSetVMs.java | 532 ++ .../models/VirtualMachineScaleSets.java | 808 ++ .../generated/models/VirtualMachineSize.java | 60 + .../models/VirtualMachineSizeListResult.java | 55 + .../models/VirtualMachineSizeTypes.java | 526 ++ .../generated/models/VirtualMachineSizes.java | 36 + ...VirtualMachineSoftwarePatchProperties.java | 179 + .../models/VirtualMachineStatusCodeCount.java | 54 + .../models/VirtualMachineUpdate.java | 243 + .../generated/models/VirtualMachines.java | 703 ++ .../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/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 + 659 files changed, 152167 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/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/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/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/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/RetrieveBootDiagnosticsDataResultInner.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/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/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/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/RetrieveBootDiagnosticsDataResultImpl.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/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/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/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/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/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/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/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/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/InstanceViewStatus.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/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/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/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/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/OSProfile.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/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/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/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/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/RetrieveBootDiagnosticsDataResult.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/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/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/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/VirtualMachineListResult.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/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/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 6306640683429..82233c990d86b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -214,6 +214,7 @@ com.azure.resourcemanager:azure-resourcemanager-datadog;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-apimanagement;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-communication;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-kubernetesconfiguration;1.0.0-beta.1;1.0.0-beta.1 +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 7243bcc987677..6f6ffc8988f95 100644 --- a/pom.xml +++ b/pom.xml @@ -598,6 +598,7 @@ sdk/boms sdk/cognitiveservices sdk/communication + sdk/compute sdk/confluent sdk/containerregistry sdk/core 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..a86465fb02d48 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-03-19) + +- Azure Resource Manager Compute client library for Java. This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2021-03-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..773f0160ad9cc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/README.md @@ -0,0 +1,99 @@ +# 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-03-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/master/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/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/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..4aa51c16f783d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml @@ -0,0 +1,67 @@ + + 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-03-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.14.0 + + + com.azure + azure-core-management + 1.2.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + 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..a2009b3654f1b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.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; + +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.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +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.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.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.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.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 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 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 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; + } + + /** + * 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 (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 BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + 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 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 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/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..33a91430aaeb9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.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.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 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(); +} 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..a4b3c6351e23f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.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.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. The response shows the list of instance view of + * the dedicated hosts under 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 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..00b2ec06a9e3d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java @@ -0,0 +1,284 @@ +// Copyright (c) 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..455dc68e0bf1d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.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.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.DiskRestorePointInner; + +/** 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); +} 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/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..1ded7d45cb4ba --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetVMsClient.java @@ -0,0 +1,953 @@ +// Copyright (c) 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..3e0200ddd444e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineScaleSetsClient.java @@ -0,0 +1,1385 @@ +// Copyright (c) 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.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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, 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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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..6c53bfeb9e8cf --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachineSizesClient.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.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/en-us/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/en-us/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..2e94644e7e8b1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/VirtualMachinesClient.java @@ -0,0 +1,1270 @@ +// Copyright (c) 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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/en-us/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/en-us/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/en-us/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/en-us/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..ef4980cc10b2f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/AvailabilitySetInner.java @@ -0,0 +1,218 @@ +// Copyright (c) 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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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/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..c722c80e11777 --- /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.Immutable; +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 +@Immutable +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..78a268d186e26 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskEncryptionSetInner.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.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.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; + + /** + * 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; + } + + /** {@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..c37d3fe07d770 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskInner.java @@ -0,0 +1,753 @@ +// Copyright (c) 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.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.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, + * or UltraSSD_LRS. + */ + @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; + + /** + * 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, or UltraSSD_LRS. + * + * @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, or UltraSSD_LRS. + * + * @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; + } + + /** {@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()); + } + } +} 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..8c0e14ac569cd --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/DiskRestorePointInner.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.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; + + /** + * 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; + } + + /** + * 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..cbe881b18c9bb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/ImageInner.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.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; + + /* + * Gets the HyperVGenerationType of the VirtualMachine created from the + * image + */ + @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: Gets the HyperVGenerationType of the VirtualMachine created from the image. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. + * + * @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/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..d3a85bf3edd7f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/PrivateEndpointConnectionInner.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.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") + 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; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * 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/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/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..90b66a30bf812 --- /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.Immutable; +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 +@Immutable +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..b73031c324eea --- /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.Immutable; +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. */ +@Immutable +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..d2aee39c60118 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/SnapshotInner.java @@ -0,0 +1,509 @@ +// Copyright (c) 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; + + /** + * 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; + } + + /** {@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/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..bed5dc7459b21 --- /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.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; + +/** Output of virtual machine capture operation. */ +@Immutable +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..6e9405039bed8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineInner.java @@ -0,0 +1,888 @@ +// Copyright (c) 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.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.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 [Manage + * the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

For more information on Azure planned maintenance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

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; + + /** + * 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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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; + } + + /** {@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(); + } + } +} 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..31913ee4d99de --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetInner.java @@ -0,0 +1,632 @@ +// Copyright (c) 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.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; + + /** + * 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; + } + + /** {@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(); + } + } +} 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..489a9ca87bb65 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineScaleSetVMInner.java @@ -0,0 +1,622 @@ +// Copyright (c) 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 [Manage + * the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintenance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    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; + + /** + * 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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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; + } + + /** {@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..997d753f0e69a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineSizeInner.java @@ -0,0 +1,183 @@ +// Copyright (c) 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. + */ + @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. + * + * @return the numberOfCores value. + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set the numberOfCores property: The number of cores supported by the virtual machine size. + * + * @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..c618e965e7c91 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/models/VirtualMachineUpdateInner.java @@ -0,0 +1,835 @@ +// Copyright (c) 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.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.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 [Manage + * the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintenance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    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; + + /** + * 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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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; + } + + /** {@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(); + } + } +} 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..0f01bfa69d39f --- /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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + availabilitySetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/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..ffcc81a41cb1f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/ComputeManagementClientImpl.java @@ -0,0 +1,789 @@ +// Copyright (c) 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.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.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 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; + } + + /** + * 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.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); + } + + /** + * 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..6bbc3f68a56c2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostGroupsClientImpl.java @@ -0,0 +1,1298 @@ +// Copyright (c) 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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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. The response shows the list of instance view of + * the dedicated hosts under 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> 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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. The response shows the list of instance view of + * the dedicated hosts under 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 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 = "2020-12-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. The response shows the list of instance view of + * the dedicated hosts under 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, 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. The response shows the list of instance view of + * the dedicated hosts under 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 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..f17c3f6ab2f46 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DedicatedHostsClientImpl.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.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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..e6efc277b2a33 --- /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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + diskAccess, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateLinkResources( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + privateEndpointConnection, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAPrivateEndpointConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..3489ea813f700 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskEncryptionSetImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.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 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) { + this.innerModel().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; + } + } + + 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..1b3fe9070e686 --- /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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..2189426c20a4e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskImpl.java @@ -0,0 +1,469 @@ +// Copyright (c) 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.CreationData; +import com.azure.resourcemanager.compute.generated.models.Disk; +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.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.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 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 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; + } + } + + 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..ca059eeb3fdeb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointImpl.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.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 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..054a64278699d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsClientImpl.java @@ -0,0 +1,627 @@ +// Copyright (c) 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.DiskRestorePointsClient; +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 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"}) + @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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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)); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..2cd41116a7dc9 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/DiskRestorePointsImpl.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.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.DiskRestorePointInner; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoint; +import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints; +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())); + } + + 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..d944a35190960 --- /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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..3177e9bc8f679 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..170e29147b958 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..e56c649d6104d --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..064915b14a9da --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..d4a8674cc79e7 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..fdd92d53ce028 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..6f75dc2bc449f --- /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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + imageName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..ba38535438472 --- /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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportRequestRateByInterval( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportThrottledRequests( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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/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..1dca528bf3079 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..adbc40935f21f --- /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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + proximityPlacementGroupName, + includeColocationStatus, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..f49d6a281c85d --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/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/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..c6479c40a0cbe --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..6d9726e70a6a9 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..5399d71acfac0 --- /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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..17637c84e589f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SnapshotImpl.java @@ -0,0 +1,347 @@ +// Copyright (c) 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.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.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 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 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; + } + } + + 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..68cddf1e382e3 --- /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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-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)); + } + + /** + * 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-09-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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-09-30"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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-09-30"; + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..a6a15d68983f5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/SshPublicKeyResourceImpl.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.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.compute.generated.fluent.models.SshPublicKeyResourceInner; +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 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..2e24dbcb7a629 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateKeyPair( + this.client.getEndpoint(), + resourceGroupName, + sshPublicKeyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/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..195bb0df98bb2 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..1f7ee0f4d35ce --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listTypes( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..6f194e81e1e87 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..80d86b7ca403a --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + location, + publisherName, + offer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..82605b94d9861 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOffers( + this.client.getEndpoint(), + location, + edgeZone, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublishers( + this.client.getEndpoint(), + location, + edgeZone, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..7be3265722337 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineImpl.java @@ -0,0 +1,532 @@ +// Copyright (c) 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.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.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.SecurityProfile; +import com.azure.resourcemanager.compute.generated.models.StorageProfile; +import com.azure.resourcemanager.compute.generated.models.VirtualMachine; +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.VirtualMachineInstanceView; +import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes; +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 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 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; + } + } + + 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..0a640a2a7a066 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..c0361ab4d3ccd --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..f1b25f2028346 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetImpl.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.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.VirtualMachineScaleSetInner; +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.UpgradePolicy; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdate; +import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile; +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 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() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachineScaleSet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachineScaleSets() + .getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, context) + .getValue(); + return this; + } + + 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 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..76747350e8748 --- /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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLatest( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..9ea1c2fa47edd --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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..0c92b66cbd238 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMImpl.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.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 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..9d533d9d45ec8 --- /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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..04cddcd50c102 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetVMsClientImpl.java @@ -0,0 +1,4529 @@ +// Copyright (c) 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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..7e768e02b9265 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsClientImpl.java @@ -0,0 +1,6593 @@ +// Copyright (c) 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.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, + @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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, 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 = "2020-12-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName) + .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) { + return getByResourceGroupAsync(resourceGroupName, vmScaleSetName).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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, 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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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/en-us/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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/en-us/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 = "2020-12-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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .forceRecoveryServiceFabricPlatformUpdateDomainWalk( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + platformUpdateDomain, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .convertToSinglePlacementGroup( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .setOrchestrationServiceState( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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..bb390afbf8e25 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineScaleSetsImpl.java @@ -0,0 +1,498 @@ +// Copyright (c) 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.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, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vmScaleSetName, 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 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, 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..30ad7c7ac81ec --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineSizesClientImpl.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.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/en-us/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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/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 = "2020-12-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/en-us/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/en-us/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/en-us/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/en-us/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..216d52debdbe2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachineUpdateImpl.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.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.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.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 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..ebd0dfbbcfa8f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,6271 @@ +// Copyright (c) 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .capture( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + forceDeletion, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .instanceView( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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/en-us/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/en-us/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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/en-us/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/en-us/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 = "2020-12-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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reapply( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .retrieveBootDiagnosticsData( + this.client.getEndpoint(), + resourceGroupName, + vmName, + sasUriExpirationTimeInMinutes, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + return FluxUtil + .withContext( + context -> + service + .simulateEviction( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assessPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .installPatches( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + installPatchesInput, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 = "2020-12-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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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/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/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..2c2d75608cc8d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DataDisk.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /** + * 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; + } + + /** + * 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..f3ea508ba8a16 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHostGroups.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.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. The response shows the list of instance view of + * the dedicated hosts under 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 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. The response shows the list of instance view of + * the dedicated hosts under 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 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..41d8bc2b883b8 --- /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.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 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. + */ +@Immutable +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..cc98c00823352 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DedicatedHosts.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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/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..fefcc1b088936 --- /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/en-us/azure/virtual-machines/windows/sizes + * and Linux VM at + * https://docs.microsoft.com/en-us/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/en-us/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/en-us/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/en-us/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/en-us/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..b8b98118a972e --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Disk.java @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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, or UltraSSD_LRS. + * + * @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 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 { + /** + * 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, or + * UltraSSD_LRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. + * @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); + } + } + /** + * 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 { + /** + * 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, or + * UltraSSD_LRS.. + * + * @param sku The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. + * @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); + } + } + /** + * 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); +} 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/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..16d54616098ce --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSet.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 { + /** + * 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); + } + } + /** + * 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.WithEncryptionType, UpdateStages.WithActiveKey { + /** + * 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 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); + } + } + /** + * 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..3217f19799009 --- /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.Immutable; +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. + */ +@Immutable +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..2fd1a140b91b8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskEncryptionSetUpdate.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.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 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; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..bc84d12659f2d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoint.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.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 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..ce67acf9d971a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskRestorePoints.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.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); +} 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..b915392dec7a8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskSku.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.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, or UltraSSD_LRS. */ +@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..1a8c708acea3a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskStorageAccountTypes.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 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"); + + /** + * 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..e4bf278ff1d6b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/DiskUpdate.java @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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, + * or UltraSSD_LRS. + */ + @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; + + /** + * 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, or UltraSSD_LRS. + * + * @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, or UltraSSD_LRS. + * + * @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; + } + + /** + * 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(); + } + } +} 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/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/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..7635d4dcd5951 --- /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.Immutable; +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. */ +@Immutable +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..99ce53f3de527 --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** This is the OS disk image. */ +@Immutable +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..ae405ddcbdaf4 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/HardwareProfile.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 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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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/en-us/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..b0802e95e7669 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Image.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.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: Gets the HyperVGenerationType of the VirtualMachine created from the image. + * + * @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: Gets the HyperVGenerationType of the VirtualMachine created from + * the image. + * + * @param hyperVGeneration Gets the HyperVGenerationType of the VirtualMachine created from the image. + * @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: Gets the HyperVGenerationType of the VirtualMachine created from + * the image. + * + * @param hyperVGeneration Gets the HyperVGenerationType of the VirtualMachine created from the image. + * @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..57fdb87e279d6 --- /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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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..bd336e872a956 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/ImageUpdate.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.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; + + /* + * Gets the HyperVGenerationType of the VirtualMachine created from the + * image + */ + @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: Gets the HyperVGenerationType of the VirtualMachine created from the image. + * + * @return the hyperVGeneration value. + */ + public HyperVGenerationTypes hyperVGeneration() { + return this.hyperVGeneration; + } + + /** + * Set the hyperVGeneration property: Gets the HyperVGenerationType of the VirtualMachine created from the image. + * + * @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/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/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..2bf0bd2b25993 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/InstanceViewTypes.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 InstanceViewTypes. */ +public enum InstanceViewTypes { + /** Enum value instanceView. */ + INSTANCE_VIEW("instanceView"); + + /** 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/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..71a37e5e0f120 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/KeyForDiskEncryptionSet.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; + +/** 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 + */ + @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. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Fully versioned Key Url pointing to a key in KeyVault. + * + * @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..22aed325d5ad8 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxConfiguration.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; + +/** + * 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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ +@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/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..d464cade59967 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/LinuxPatchSettings.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.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; + + /** + * 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; + } + + /** + * 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/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/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..b9d268913589c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkInterfaceReference.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.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; + + /** + * 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; + } + + /** {@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..5a1a132ef1605 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/NetworkProfile.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 the network interfaces 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; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/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..653e055041ee1 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSDisk.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ +@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; + + /** + * 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; + } + + /** + * 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..3027fb3cce53e --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Contains encryption settings for an OS disk image. */ +@Immutable +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/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..cc1ef40f47a50 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/OSProfile.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.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/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + */ + @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

  • For root access to + * the Linux VM, see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + */ + @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/en-us/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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @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/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @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/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @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 + * <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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 + * <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). + * + * @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). + * + * @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/en-us/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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/en-us/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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/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/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..ee36e84bfea19 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/PatchSettings.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; + +/** 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; + + /** + * 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; + } + + /** + * 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/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..3b676f8aad2c3 --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Specifies information about the proximity placement group. */ +@Immutable +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/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/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/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/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..de9a76ba5bf33 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SecurityTypes.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 SecurityTypes. */ +public enum SecurityTypes { + /** Enum value TrustedLaunch. */ + TRUSTED_LAUNCH("TrustedLaunch"); + + /** The actual serialized value for a SecurityTypes instance. */ + private final String value; + + SecurityTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SecurityTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed SecurityTypes object, or null if unable to parse. + */ + @JsonCreator + public static SecurityTypes fromString(String value) { + SecurityTypes[] items = SecurityTypes.values(); + for (SecurityTypes 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/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..10b41f0ea6f8a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/Snapshot.java @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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); +} 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..036bb03f8d40d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SnapshotUpdate.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.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; + + /** + * 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; + } + + /** + * 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/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..65d482eaa2ebe --- /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/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @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/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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..8e49711cfd78a --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/SshPublicKeyResource.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.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); +} 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/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..c38e661fc76cb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/StorageAccountTypes.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 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"); + + /** + * 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..813697a5c45d8 --- /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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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..61213cc64630b --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.OffsetDateTime; + +/** Api request input for LogAnalytics getThrottledRequests Api. */ +@Immutable +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/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..d97f91a707bb5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachine.java @@ -0,0 +1,1105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 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 { + /** + * 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 [Manage the + * availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for + * virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 [Manage the + * availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for + * virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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); + } + } + /** + * 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 { + /** + * 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 [Manage the + * availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for + * virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 [Manage the + * availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for + * virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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); + } + } + /** + * 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); +} 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/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/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/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..95447190b5040 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSet.java @@ -0,0 +1,738 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 { + /** + * 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); + } + } + /** + * 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); +} 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..d453c1d45fed5 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkConfiguration.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /** + * 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; + } + + /** {@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..345a7ffc93393 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetNetworkProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** + * 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; + } + + /** + * 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..929959643f640 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetOSProfile.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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

  • For root access to + * the Linux VM, see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + */ + @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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + */ + @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + @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 <br><br><li> For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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 <br><br><li> For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> + * For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for + * Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). + * + * @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/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). + * + * @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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @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..54599fc618c73 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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 (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..e1e7e1c36eb69 --- /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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @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..994411daf1b16 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /** + * 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; + } + + /** {@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..a0089e6899071 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateNetworkProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + + /** + * 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; + } + + /** + * 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..8403fe48482f2 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.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.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; + + /** + * 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; + } + + /** + * 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..8af8f2820855f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetUpdateVMProfile.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /** + * 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; + } + + /** + * 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..00400f198ea52 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVM.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.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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 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..3f556f8f355ff --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMProfile.java @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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; + + /** + * 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; + } + + /** + * 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/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..2f69ea1660867 --- /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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +@Immutable +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..f4bde94fb4460 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSetVMs.java @@ -0,0 +1,532 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..d3f51a1dbc619 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineScaleSets.java @@ -0,0 +1,808 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, 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/en-us/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/en-us/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/en-us/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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, 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..dd1f83d470aeb --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSize.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.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. + * + * @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..bc1529e4b2b9d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineSizes.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 VirtualMachineSizes. */ +public interface VirtualMachineSizes { + /** + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/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/en-us/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..b6d1c3704179c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachineUpdate.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <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 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..5dcee5c8b61a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/models/VirtualMachines.java @@ -0,0 +1,703 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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/en-us/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/en-us/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/en-us/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/en-us/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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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..518033c179d90 --- /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/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + * value from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/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/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + * value from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/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/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + * value from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/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/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 + + + +